Wowza Community

Using VLC with Wowza Pro (native RTP)

Try something more like this command line:

vlc -vvv dshow:// :dshow-vdev="QuickCam for Notebooks Pro" :dshow-adev="Logitech Mic (Notebooks Pro)" :dshow-size="640x480" --sout "#transcode{venc=x264,vcodec=x264,vb=500,scale=1,acodec=mp4a,ab=32,channels=2,samplerate=22100}:rtp{dst=[ec2-public-domain-name],port-video=10000,port-audio=10002,sdp=http://[vlc-ip-address]/vlc.sdp}"

where [ec2-public-domain-name] is the domain name of the ec2 image and [vlc-ip-address] is the ip address of the machine running VLC.

You will also need to open up udp port 10000-10003 in EC2 to traffic:

ec2-authorize default -P udp -p 10000-10003

You will pick up the SDP information by using the stream name:

Server: rtmp://[ec2-public-domain-name]/rtplive

Stream: http://[vlc-ip-address]/vlc.sdp

VLC and EC2 in combination is tricky. It might requires lots and lots of expirmentation and Googling. This should get you going on the right track. I have not tried it myself.

Charlie

Why don’t you try the suggest command line:

vlc -vvv c:\wms\content\Extremists.m4v --sout "#transcode{venc=x264,vcodec=x264,vb=500,scale=1,acodec=mp4a,ab=32,channels=2,samplerate=22100}:rtp{dst=127.0.0.1,sdp=file://%WMSCONFIG_HOME%/content/Extremists.sdp}"

Just change c:\wms\content\Extremists.m4v to a valid path to the sample Extremists.m4v file. To play the stream use the stream name:

Extremists.sdp

Get this working first.

Charlie

We only support H.264/AAC over RTP. So it must be H.264 or AAC content. We do no support MP3 over this protocol.

Charlie

Please post the warning/error messages from the Wowza Pro logs. Be sure that the ip address that Wowza Pro is trying to bind to is correct. It must be valid ip address on the machine running Wowza Pro. You can see the valid ip addresses on a machine by executing the command:

Linux/OSX:

ifconfig

Windows:

ipconfig/all

If it is not then edit the SDP file generated by VLC and change the line that starts with “c=” to point to the correct address.

Charlie

You need to send the stream from the server running VLC to the server running Wowza Pro. The destination ip address in the VLC command line needs to be that of the server running Wowza Pro. The SDP file should contain the ip address of the server running Wowza Pro (not the server running VLC). VLC is sending the stream to the Wowza Pro ip address. Wowza Pro should be binding to the ip address of the server on which it is running.

Make sense?

Charlie

The stream cannot start until it hits a key frame. So that is most likely the cause of the long delay. It is waiting for a key frame. See if there is a way in VLC in increase the key frame interval.

Second, the rtp-live system is a pull based on demand method. So the stream is not started util the first client connects. It then remains running until the last client disconnects then it waits 10 seconds for additional connections and shuts down if no connections are made. So this long delay start will only occur for the first viewer of the stream.

We do have a module to allow you to control when the stream starts/stops. Take a look at this package:

http://www.wowza.com/community/t/-/54

Charlie

Yes, the player also needs a key frame. So if the key frame interval is huge then it is going to be a problem. VLC is not a great choice. I would find your self a better encoder.

Charlie

Then try the following. Install the most recent patch:

WowzaMediaServerPro1.6.0-patch19.zip

This improves UDP performance and adds a few RTP features.

Set the key frame interval to 2 seconds (keyint=2,idrint=2). See if this improves the startup time. Test both the initial connection startup time as well as the second connection startup time. Use our example player (examples/LiveVideoStreaming).

If this does not improve the startup time then turn on debug logging and send me the debug logs files (charlie@wowza.com).

Charlie

Basicall this:

vlc -vvv -I rc dshow:// :dshow-adev="Logitech Mic (Notebooks Pro)" --sout "#transcode{acodec=mp4a,ab=32,channels=2,samplerate=22050}:rtp{dst=127.0.0.1,sdp=file://%WMSCONFIG_HOME%/content/vlc.sdp}"

Of course different devices but that is basically it.

Charlie

You can see if it is a transport issue by turning on a jitter buffer and logging packet loss. See this forum post:

http://www.wowza.com/community/t/-/51

You will see log statements if there are holes in the packet delivery.

Charlie

You certainly can set the ttl in vlc. Not sure how to do it. I have seen the “packet sent too late” messages as well. Not sure what this means. It has never caused any problems for me on the playback side.

Charlie

That might help. I would suggest between 2-5 seconds of buffer. Are you seeing packet loss? This can also lead to buffering issues.

Charlie

If you are seeing packet loss on a local lan this is usually some kind of hardware issue (router, firewall, switch, network card). There are really not magic software bullets for fixing this. I might try to see if you can figure out where the packets are being dropped.

Charlie

My understanding is that H.264 encoding has been broken in VLC for quite some time. The most recent version that works is 0.8.6i. You will see in one of the Notes paragraphs in the first post of this thread it points you to the most recent version that works. This feature has been broken in VLC for quite some time. I think it has been over a year.

Charlie

Please do send or post the error messages (charlie@wowza.com).

Charlie

Yes, they need to be 2 different SDP files and use different ports. Yes, Wowza Media Server can handle them both at the same time.

Charlie

Please post the contents of the two SDP files.

Charlie

Yes, as long as all the UDP ports that are being used to send the stream from VLC to Wowza are open it should work.

Charlie

I edited the first post. You will see that I now surround the file name in double quotes. This should fix this error.

Charlie

I have some success with the above examples and also was able to re-size the picture using the following command line, as an example which squeezes the video to dial-up compatible bandwidths and streams it to Wowza…

[PHP]vlc test.flv --sout ‘#transcode{width=160,height=120,venc=x264,vcodec=x264,vb=16,acodec=mp4a,ab=16,channels=1,samplerate=11025}:duplicate{dst=rtp{dst=127.0.0.1,sdp=file:///usr/local/WowzaMediaServerPro/content/vlc.sdp}}’ vlc:quit[/PHP]

I am using a file source rather that live source (which also works), just to keep things simple for testing. I am using VLC version 0.8.6f compiled by PLF on Mandriva 2008.1.

Now I would like to send three streams at different bandwidths so that the client can choose a low, medium or high bandwidth stream. I did a test saving to files with VLC and found it was possible to run three concurrent transcodes as in the example below…

[PHP]vlc test.flv --sout ‘#duplicate{dst=“transcode{width=640,height=480,venc=x264,vcodec=x264,vb=300,acodec=mp4a,ab=128,channels=2,samplerate=44100}:duplicate{dst=display,dst=std{access=file,mux=mp4,dst=test1.mp4}}”,dst=“transcode{width=320,height=240,venc=x264,vcodec=x264,vb=96,acodec=mp4a,ab=96,channels=2,samplerate=44100}:duplicate{dst=display,dst=std{access=file,mux=mp4,dst=test2.mp4}}”,dst=“transcode{width=160,height=120,venc=x264,vcodec=x264,vb=16,acodec=mp4a,ab=16,channels=2,samplerate=11025}:duplicate{dst=display,dst=std{access=file,mux=mp4,dst=test3.mp4}}”}’ vlc:quit[/PHP]

Finally, I tried sending three RTP streams to the Wowza server running on the same machine. However I couldn’t view anything except once when I got a few frames of scrawl from the vlc2.sdp stream…

[PHP]vlc test.flv --sout ‘#duplicate{dst=“transcode{width=640,height=480,venc=x264,vcodec=x264,vb=300,acodec=mp4a,ab=128,channels=2,samplerate=44100}:duplicate{dst=rtp{dst=127.0.0.1,sdp=file:///usr/local/WowzaMediaServerPro/content/vlc1.sdp}}”,dst=“transcode{width=320,height=240,venc=x264,vcodec=x264,vb=96,acodec=mp4a,ab=96,channels=2,samplerate=44100}:duplicate{dst=rtp{dst=127.0.0.1,sdp=file:///usr/local/WowzaMediaServerPro/content/vlc2.sdp}}”,dst=“transcode{width=160,height=120,venc=x264,vcodec=x264,vb=16,acodec=mp4a,ab=16,channels=2,samplerate=11025}:duplicate{dst=rtp{dst=127.0.0.1,sdp=file:///usr/local/WowzaMediaServerPro/content/vlc3.sdp}}”}’ vlc:quit[/PHP]

I also tried running three concurrent instances of VLC as shown below with the same result…

[PHP]vlc test.flv --sout ‘#transcode{width=160,height=120,venc=x264,vcodec=x264,vb=16,acodec=mp4a,ab=16,channels=1,samplerate=11025}:duplicate{dst=rtp{dst=127.0.0.1,sdp=file:///usr/local/WowzaMediaServerPro/content/vlc3.sdp}}’ vlc:quit &>/dev/null &

vlc test.flv --sout ‘#transcode{width=320,height=240,venc=x264,vcodec=x264,vb=96,acodec=mp4a,ab=96,channels=2,samplerate=44100}:duplicate{dst=rtp{dst=127.0.0.1,sdp=file:///usr/local/WowzaMediaServerPro/content/vlc2.sdp}}’ vlc:quit &>/dev/null &

vlc test.flv --sout ‘#transcode{width=640,height=480,venc=x264,vcodec=x264,vb=300,acodec=mp4a,ab=128,channels=2,samplerate=44100}:duplicate{dst=rtp{dst=127.0.0.1,sdp=file:///usr/local/WowzaMediaServerPro/content/vlc1.sdp}}’ vlc:quit &>/dev/null &[/PHP]

CPU usage was about 60% each of two CPU cores. It didn’t seem to max out.

I have a feeling I am missing something quite fundamental about how RTP streams work and that the three streams may all be munged together as far as the Wowza server and client are concerned. If this is the case then how do I separate the streams so that they play correctly?