•  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  • Contact  
  •  

PHP Live Streaming

VideoWhisper > Live Streaming > PHP Stand Alone
Live Video Streaming Software
  • Create Live Video Channels
  • Broadcast Live Video from Browser
  • Share Channels Link
  • HTML Embed Code
  • Limit Total Use Time by Channel
  • Simple Setup
  • Tips ($) with Sound and Message
  • Easy to Install, Configure
  • Full PHP Source Code
  • Easy to Integrate
  • Transcoding Support for HTML5 playback
    HLS iOS / MPEG DASH Android
  • WebRTC HTML5 broadcast/playback server support
Live Streaming PHP Webcam ScriptThe php edition is the easiest choice to setup and run the Live Streaming application on a website and broadcast live video from webcam to site pages.

Also use this edition to integrate with any php script or content management system that does not have a turnkey integration, yet.

Supports web based interfaces for broadcasting live video, watching live video, text chat discussions with viewers. More advanced features like access and session duration control, tips for broadcasters can be enabled and integrated as needed.

Delivery of plain live video stream using HTML5 is supported: as HLS for PC Safari and iOS/Android mobiles, as MPEG-DASH for PC Chrome and Android mobiles. HTML5 WebRTC broadcas/playback is also possible using a relay WebRTC server.
HTML5 support requires Wowza SE for delivery and account level on request transcoding based on FFMPEG and flash/html5 codecs - all these requirements are available with the complete turnkey hosting plans.

WebRTC HTML5 plain broadcast and playback is also available. This also uses the relay streaming server, meaning it does not require server grade connection for broadcaster and streams are available across all delivery formats (advanced Flash RTMP interface, plain HTML5 HLS/DASH, plain HTML5 WebRTC ).

For a more advanced implementation see Broadcast Live Video , turnkey live streaming site solution that includes channel and user management, access control, advanced conversions, responsive features for automated mobile support.

Find on this page more info about PHP Live Streaming:


Demo for Live Video Streaming Script

Enter Live Streaming Broadcast Demo

How to test:

  1. Publish channel (you can specify a name or a StudioYYY name will be automatically generated)
  2. Allow access to your webcam and select the camera/audio source if you have multiple on your system.
  3. Click the "Channel Link" box (the link will be automatically copied)
  4. Send link to your friends to watch or open a new browser window or tab and paste the url there to access the viewer interface for that channel or send
  5. Test the multiple playback interfaces available (watch and discuss, only video, text chat, transcoder for HLS / MPEG DASH playback, WebRTC broadcast/playback).

Installation Instructions for PHP Live Video Streaming Software

Before installing, make sure your hosting environment meets all requirements.
For enabling transcoding for HTML5 HLS / MPEG DASH playback required for iOS/Android delivery, special requirements apply: latest Wowza and FFMPEG with Flash and HTML5 specific codecs. WebRTC broadcast/playback require specific configuration and SSL certififcate for Wowza SE available with the turnkey complete streaming hosting plans.

  1. If you're not hosting RTMP with us go to RTMP Application Setup for installation details
  2. Download archive, unzip and copy contents of ls_php to your web installation location. (Example: www.yoursite.com/live/)
  3. Fill your RTMP path into settings.php
  4. If you don't have SuPHP, enable write permissions (0777) for folders: snapshots, uploads
  5. To enable transcoding for HTML5 playback, configure HLS / MPEG DASH as per Wowza specs and fill httpstreamer & httpdash setting in settings.php .
    If you have turnkey hosting with us, our staff can assist with setting this up (our plans come with a rtmp address preconfigured for such usage).

Customizing & Integrating Live Video Streaming on your site


  • To integrate this with other scripts read an integration overview for videowhisper applications first, to understand the framework and where to start from.
  • Edit panel skins, icons, sounds in templates/live
  • Change emoticons from emoticons folder. Update emoticons/emoticons.xml to reflect new emoticons list. 
  • Edit/add translations in translation.php . If you need a certain text translated and don't find a way to do it contact our staff for assistance. 
  • Edit panel title font, size, color in css.php
  • This can be integrated with your members database and login system. Variables like username, loggedin (1 if user was logged in and allowed to enter, 0 otherwise), welcome message, visitor ( 1 if user is visitor and needs to provide a name in watch interface, 0 otherwise), timer settings are passed from these files:
    • vc_login.php : Video Broadcasting Interface (live_broadcast.swf)
    • vs_login.php : Video Watch and Discuss Interface (live_watch.swf)
    • vv_login.php : Live Video Interface (live_video.swf)
  • Broadcasting webcam settings (bandwidth, resolution, frames per second) and limitations (settings panel, advanced settings panel, maximum bandwidth) are also configured in vc_login.php
  • Broadcasting interface reports active broadcasters to lb_status.php. This also controls timer and can terminate session.
  • On logout broadcaster is redirected to lb_logout.php .
  • Included players report active watches to v_status.php which controls time and can terminate session. Edits this to implement ppv/ppm functionality for users watching video.
    • Change $maximumSessionTime=0 to limit maximum session time in milliseconds (set it to 600000 for 10 minutes)
    • You can also implement code to save a cookie (to check and prevent log back for a certain time) and disconnect by setting a custom disconnect message for user in $disconnect .
  • Channel page can be edited and flash resized as needed: channel.php
    Also there's a sample plain video page: video.php
  • Snapshots for all channels are saved in the snapshots folder as jpg. Size depends on webcam resolution.
  • There are multiple parameters to edit. In example in vc_login.php there are many configuration options for video broadcasting interface:
    • connection settings: server=<?=$rtmp_server?>&serverAMF=<?=$rtmp_amf?>&tokenKey=<?=$tokenKey?>
      &serverProxy=best : "none", "HTTP", "CONNECT", "best"
      To use native SSL, set the property to "best". If the player cannot make a direct connection to the server (over the default port of 443 or over another port that you specify) and a proxy server is in place, the player tries to use the CONNECT method. If that attempt fails, the player tunnels over HTTPS.
      If the property is set to "HTTP" and a direct connection fails, HTTP tunneling is used. If the property is set to "CONNECT" and a direct connection fails, the CONNECT method of tunneling is used. If that fails, the connection does not fall back to HTTP tunneling.
      This property is applicable only when using RTMP, RTMPS, or RTMPT. The CONNECT method is applicable only to users who are connected to the network by a proxy server.

    • p2p settings: &serverRTMFP=<?=$rtmfp_server?>&p2pGroup=VideoWhisper
      &enableRTMP=1&enableP2P=0&supportRTMP=1&supportP2P=1&alwaysRTMP=0&alwaysP2P=0
      enable Default setting.
      support Allows broadcaster to use that streaming mode.
      always Always enabled (ie. alwaysRTMP to make sure all streams go to server for archiving/external publishing) .
    • webcam / microphone streaming settings:
      &camWidth=320&camHeight=240&camFPS=15 - resolution and framerate
      &camBandwidth=40960 - in bytes/s , see recommended h264 bandwidth based on resolution
      &camPicture=50 - minimum picture quality (0-100), set 0 for max frame rate (dynamic quality to keep desired framerate)
      &micGain = 50 - microphone amplification (0-100)
    • H264 codec settings: &videoCodec=H264&codecProfile=main&codecLevel=3.1
      videoCodec: H264 / other value uses default codec
      codecProfile: baseline/main for H264
      codecLevel: 1, 1b, 1.1, 1.2, 1.3, 2, 2.1, 2.2, 3, 3.1, 3.2, 4, 4.1, 4.2, 5, 5.1 for H264
    • sound codec settings: &soundCodec=Speex&soundQuality=9&micRate=22
      soundCodec: Speex/Nellymoser
      micRate: 11/22/44 for Nellymoser (certain browser/flash plugin combinations cause video interruptions when using 44)
      soundQuality: 0-10 for Speex
    • logo overlay: &overLogo=logo.png&overLink=https://videowhisper.com
    • channel (room) details: &room=<?=$username?>&welcome=Welcome!&defaultTitle=LIVE
    • user login and type: &username=<?=$username?>&userType=3&webserver=&msg=&loggedin=1
    • user picture and profile link: &userPicture=<?=$userPicture?>&userLink=<?=$userLink?> - user snapshot and profile link
    • embed codes: linkcode=<?=urlencode($linkcode)?>&embedcode=<?=urlencode($embedcode)?>&embedvcode=<?=urlencode($embedvcode)?>&imagecode=<?=urlencode($imagecode)?>
    • room limitations: room_limit=&showTimer=1&showCredit=1&disconnectOnTimeout=1
    • dynamic buffering settings: &bufferLive=0.2&bufferFull=0.2
    • runtime editable settings: &showCamSettings=1&advancedCamSettings=1&camMaxBandwidth=81920&configureSource=1
    • snapshots: &generateSnapshots=1&snapshotsTime=15000 Enable sending jpg webcam snapshots to server.
    • layout and features:
      &onlyVideo=0&noEmbeds=0&noTitle=0 Hide everything but video or just embed codes, show title interface.
      //layout obtained by sending in public chat box "/videowhisper layout"; fill in new line between layoutEND markers
      $layoutCode=<<<layoutEND
      id=0&label=Webcam&x=10&y=40&width=242&height=235&resize=true&move=true; id=1&label=Chat&x=260&y=40&width=340&height=235&resize=true&move=true; id=2&label=Users&x=610&y=40&width=180&height=235&resize=true&move=true
      layoutEND;

    • external text chat: &externalInterval=6000 Defines how often external chat messages are checked for (by calling vw_extchat.php), in milliseconds. Set 0 or any number lower than 500 to disable.
      Many of these parameters are also working with vv_login.php and vs_login.php for watch and video interfaces.
    • &supportTips=1 Load tip sounds.
  • From vs_login.php, watch interface can be configured:
    • layout and features: &disableVideo=0&disableChat=0&disableUsers=0&layoutCode=<?=urlencode($layoutCode)?>&fillWindow=0
      //after getting it from text chat with /videowhisper layout fill your layout code between <<<layoutEND and layoutEND;
      $layoutCode=<<<layoutEND
      layoutEND;

    • text chat filters: &filterRegex=<?=$filterRegex?>&filterReplace=<?=$filterReplace?>
      //replace bad words or expressions
      $filterRegex=urlencode("(?i)(badword1|badword2)(?-i)");
      $filterReplace=urlencode(" ** ");
    • text chat control: &writeText=1&floodProtection=3&privateTextchat=1
    • broadcaster offline message: &offlineMessage=Channel+Offline
    • status script calls: &statusInterval=10000 Define how often status script v_status.php is called
    • in chat ads: ws_ads=<?=urlencode("ads.php")?>&adsTimeout=15000&adsInterval=240000 Display ads right inside text chat
      Setup adsInterval in milliseconds (0 to disable ad calls), adsTimeout to setup time in milliseconds until first ad is shown. Also see AD in Chat compatible ad management server.
    • tips: sendTip=1&supportTips=1
      Selectable tips are configured in tips.php and processing must be integrated from tip.php .
  • From vv_login.php, video only interface can be configured:
    • &overLogo=logo.png&overLink=https://videowhisper.com - floating logo
    • &msg=<?=$msg?>&visitor=1&loggedin=<?=$loggedin?>
    • &showCredit=1&disconnectOnTimeout=1&statusInterval=10000 - based on v_status.php
    • &showViewers=1&viewersMessage=<?=urlencode(' viewers live')?> - viewers count
    • &offlineMessage=Channel+Offline&liveMessage=Live
    • &noSound=0 - mute
    • &controlSpacing=6&controlSize=24 - controls: pause/play
  • PHP edition also contains these additional views accesible from each standard channel page:
    video.php?n=Channel - only video stream player
    htmlchat.php?n=Channel - external text chat (to access from devices without video capability or integrate with other chat systems)
  • Usage time limits can be configured in settings.php:
    //usage limit (per channel and per viewer)
    //default 2 hours per week limit
    $maximumSessionTime=7200000; //7200000 ms = 2h; 0 for unlimited
    $resetTime = 7 * 3600 * 24; //weekly
    $limitChannel=1; //counts total channel time (sum of time online for broadcaster + viewers)
    $limitUser=1; //counts total view time per user (watching all channels)
  • Usage time limits are implemented in v_status.php (for viewers) and lb_status.php (for broadcaster). These close session with "disconnect" variable when time limit is reached.
    Sample implementation saves time usage counters in uploads/_users/$username for each viewer (on all channels) and uploads/$room/online/$room per room (broadcaster + all viewers).

HTML5 WebRTC Implementation

WebRTC Publish Features

  • Select Camera (Webcam for PC, Front/Back for mobiles)
  • Select Microphone
  • Select Resolution

Solution implements WebRTC for streaming to/from media relay server. This brings compatibility for some HTML5 mobile browsers, to allow streaming directly from site without configuring stand alone encoder apps.
Media server is still required and used as a relay for scalability, reliability and cross protocol stream availability. Relay server also manages sessions and advanced interactions in real time.
Why not use P2P? As standard WebRTC implementations utilize peering networks, there still has to be a nearby node to help distribute the stream to other local hosts. Peering across a global network can be incredibly difficult.
Broadcasters would need server grade connections to live stream to multiple users and using a regular home ADSL connection (that has has higher download and bigger upload) causes real issues.

Details, Forums, Downloads


Order Now!   Instant 100% web based video communications for your business. WELCOME TO THE NEXT LEVEL!