Note: I am providing these instructions on as “AS-IS” basis. The reason for the qualification is because I have found VLC to be difficult to get to work reliably and predictably.
Step by step instructions for using the VLC media player as an encoder with Wowza Pro (Flash Player version 9.0.115.0 or greater is required).
-
Download and install Wowza Media Server Pro (version: Wowza Pro 1.7.2 or greater)
-
Create a new Wowza Pro application for streaming (may already exist if examples installed)
-
Create the folder [install-dir]/applications/rtplive
-
Create the folder [install-dir]/conf/rtplive
-
Copy the file [install-dir]/conf/Application.xml into this new folder [install-dir]/conf/rtplive
-
Edit the newly copied Application.xml and change Streams/StreamType to rtp-live and change RTP/AVSyncMethod method to systemclock
-
Startup the Wowza Pro server
-
Hook up webcamera to PC
-
Download and install VLC media player
-
Startup VLC media player and extract the web camera and microphone info to build a VLC command line
-
Select menu item File>Open Capture Device… and select the DirectShow from the Capture mode popup
-
Click the Refresh list buttons for the Video device name and Audio device name lists
-
Select your web camera and microphone from the drop down lists and set the Video size field to 640x480
-
Check the Show more options checkbox and copy and paste the string in the Edit Options field into a text document (we will be using this later to build a command line for VLC)
-
In a text editor we are going to build the command line for VLC. It will use the web camera and microphone information we collected above along with some transcoding and transport properties. Your finished command line should look something like this:
Windows: vlc -vvv -I rc dshow:// :dshow-vdev="QuickCam for Notebooks Pro" :dshow-adev="Logitech Mic (Notebooks Pro)" :dshow-size="320x240" --sout "#transcode{venc=x264{keyint=60},vcodec=x264,vb=500,scale=1,acodec=mp4a,ab=32,channels=2,samplerate=22050}:rtp{dst=127.0.0.1,port-video=10000,port-audio=10002,sdp=file://%WMSCONFIG_HOME%/content/vlc.sdp}" Windows (iPhone compatible): vlc -vvv -I rc dshow:// :dshow-vdev="QuickCam for Notebooks Pro" :dshow-adev="Logitech Mic (Notebooks Pro)" :dshow-size="320x240" --sout "#transcode{venc=x264{keyint=60,profile=baseline,level=3.0,nocabac,qpmax=36,qpmin=10,me=hex,merange=24,subme=9,qcomp=0.6},vcodec=x264,vb=500,scale=1,acodec=mp4a,ab=96,channels=2,samplerate=48000}:rtp{dst=127.0.0.1,port-video=10000,port-audio=10002,sdp= file://%WMSCONFIG_HOME%/content/vlc.sdp}"
Where:
-
First section is the web camera and microphone info collected above
-
transcode section describes the video/audio format of the stream
-
rtp section sets the destination ip address and output location of .sdp file
Or you can re-stream the Extremists.m4v video as a live stream. The following command line worked for me:
Windows: vlc -vvv -I rc "%WMSCONFIG_HOME%/content/Extremist.m4v" --sout "#transcode{venc=x264{keyint=60},vcodec=x264,vb=500,scale=1,acodec=mp4a,ab=32,channels=2,samplerate=22050}:rtp{dst=127.0.0.1,port-video=10000,port-audio=10002,sdp=file://%WMSCONFIG_HOME%/content/vlc.sdp}" Windows (iPhone compatible): vlc -vvv -I rc "%WMSCONFIG_HOME%/content/Extremist.m4v" --sout "#transcode{venc=x264{keyint=60,profile=baseline,level=3.0,nocabac,qpmax=36,qpmin=10,me=hex,merange=24,subme=9,qcomp=0.6},vcodec=x264,vb=500,scale=1,acodec=mp4a,ab=96,channels=2,samplerate=48000}:rtp{dst=127.0.0.1,port-video=10000,port-audio=10002,sdp= file://%WMSCONFIG_HOME%/content/vlc.sdp}"
Or you can re-stream an RTSP/RTP stream (IP camera). The following command line worked for me (where rtsp://192.168.1.108:554/axis-media/media.amp is the URL to my IP camera):
Windows: vlc -vvv -I rc rtsp://192.168.1.108:554/axis-media/media.amp --sout "#transcode{venc=x264{keyint=60},vcodec=x264,vb=500,scale=1,acodec=mp4a,ab=32,channels=2,samplerate=22050}:rtp{dst=127.0.0.1,port-video=10000,port-audio=10002,sdp=file://%WMSCONFIG_HOME%/content/vlc.sdp}" Windows (iPhone compatible): vlc -vvv -I rc rtsp://192.168.1.108:554/axis-media/media.amp --sout "#transcode{venc=x264{keyint=60,profile=baseline,level=3.0,nocabac,qpmax=36,qpmin=10,me=hex,merange=24,subme=9,qcomp=0.6},vcodec=x264,vb=500,scale=1,acodec=mp4a,ab=96,channels=2,samplerate=48000}:rtp{dst=127.0.0.1,port-video=10000,port-audio=10002,sdp= file://%WMSCONFIG_HOME%/content/vlc.sdp}"
-
Open a command prompt change directory to: C:\Program Files\VideoLAN\VLC and copy and paste the command line that you build above
-
To play the stream, double click [install-dir]/examples/NativeRTPVideoStreaming/client/live.html, set Server to rtmp://[server-ip-address]/rtplive and Stream to vlc.sdp and click the Play button
[install-dir]
Windows (default): C:\Program Files\Wowza Media Systems\Wowza Media Server Pro [version]
Mac OS X: /Library/WowzaMediaServerPro
Linux: /usr/local/WowzaMediaServerPro
Note: Version VLC media player 1.0.2 Goldeneye seems to be working well for me on Windows. The above command line works with my web camera and the Extremists.m4v sample video.
Note: The audio and video may be out of sync. This is because VLC does not generate RTCP packets which are required to synchronize the audio and video channels. You may also want to experiment with setting the RTP/AVSyncMethod method in [install-dir]/conf/rtplive/Application.xml to rtptimecode to see if this produces better results.
Note: If you want to host VLC on a different machine as the server hosting Wowza Media Server, you can modify any of the command lines above by changing dst=127.0.0.1 to the ip address of the server running Wowza Media Server. You will also need to output the SDP file to a folder on the machine running VLC then copy it to the [install-dir]/content directory of the server running Wowza Media Server. The SDP file only needs to be updated if any of the encoding parameters or port numbers change.
Note: If you experience problems getting either the audio or video to play through Flash, double check the version number of the Flash player (Flash player version 9.0.115.0 or above is required). If you still have problems, turn on Wowza Pro debug logging (edit [install-dir]/conf/log4j.properties and change the log4j.rootCategory on the first line from INFO to DEBUG), try the encoder several more times, zip up and send your [install-dir]/logs folder along with screen shots of the encoder setup screens and the LiveVideoStreaming player screen and send a detailed description of your problem to support@wowza.com.
updated for version: VLC media player 1.0.2 Goldeneye.
Charlie