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?