Page 1 of 1

Multicasting and SDP file

Posted: 21 Jul 2009 02:34
by Helium
Hello everyone. I've been using VLC for a while, and I've found it a very flexible and powerful software. I'd like to take the opportunity to congratulate the developers ofr coming up with such a great product.

Now to the problem: I need to serve lectures, by transmitting a Live stream coming in from a Pro webcam (Logitech Pro 9000) to users in several locations. These users run Windows PCs, and are too many to make it feasible to install VLC player on each, so I need the feed to be "tunable" with the programs they already have installed, Windows Media Player 9 and QuickTime 7, that are included in our std images.
Serving using MMS /MMSH with ASF encapsulation is well documented and works like a charm, but it's unicast, and I need this to be Multicast so I can reach many (100s of) users with the low available bandwidth.

Code: Select all

call "C:\Program Files\VideoLAN\VLC\vlc.exe" -vvv dshow:// :dshow-vdev="Logitech QuickCam Pro 9000" :dshow-adev="Logitech Mic (Pro 9000)" :dshow-size=640x480 :dshow-caching=200 :dshow-chroma= :dshow-fps=15 :no-dshow-config
and then on the output:

Code: Select all

:sout=#transcode{vcodec=WMV2,vb=800,fps=15,scale=1,acodec=wma2,ab=64,channels=1,samplerate=44100}:std{access=mmsh,ttl=11,mux=asfh,dst=<local_ip>:8234}
I know I can then listen to the above stream, coming from the "capture & transcode" PC into a server that would then only have to "serve" to as many clients as possible, but then that would only fix the issue in the LAN of the transmitting site, not remote sites.

So looking at the matrixes in http://www.videolan.org/streaming-features.html I found it obvious that I needed to go with RDP, TS mux, and a choice of codecs like mp4v & mp4a that would easily be decoded by QT, or maybe RealPlayer if it was available by chance.
As the input side was working OK, I did not touch it, and started working with options on the :sout side.

My base line now became:

Code: Select all

:sout=#transcode{vcodec=mp4v,vb=800,fps=15,scale=1,acodec=mp4a,ab=64,channels=1}:rtp{mux=ts,dst=239.255.0.1,port=1234,ttl=6}
I also played mixes with acodec=mp3 and vcodec=h264, but results were the same. I was able to "tune" the broadcast using VLC "rtp://@239.255.0.1", but not from other players because they don't support that kind of URL. So I expanded the :sout line above with "sdp=http://<local_ip>:80/conference.sdp" and "sdp=file://c:/conference.sdp". As stated by the documenttion, using "sdp=rtsp://" would work only for unicast, which is not what I need.

I found that the http option created the http server and served the sdp file, but no player could tune the broadcast: VLC nor QT nor Real. VLC would simply receive the SDP and do nothing else. QT would say it was playing the stream, and show an incoming strem worth 1Mbps, according to it's info window, but output nothing . No audio & no video, so it was able to succesfully receive the stream, but everyting was going into "/dev/null" . Last, but not least, RealPlayer would give an error saying it would need to download a codec, and then that none was available for "video/MP2T". So I tested again with VLC, this time pointing to the RTP stream and "voilá" instant image and audio output.

So VLC was able to correctly find out which codecs it needed to use to decode the audio+video stream, but could not do so by using its own sdp file. Version is 1.0.0.

Realizing this had to do with the SDP file, I changed the :sout line to a local file, in order to see its contents with notepad and/wordpad. What I found is this:

Code: Select all

v=0 o=- 14848206250698834727 14848206250698834727 IN IP4 <local_WINDOWS_name> s=Unnamed i=N/A c=IN IP4 239.255.0.1/255 t=0 0 a=tool:vlc 1.0.0 a=recvonly a=type:broadcast a=charset:UTF-8 m=video 1234 RTP/AVP 33 b=RR:0 a=rtpmap:33 MP2T/90000
I don't honestly know what the -o line means, and I still have pending obtaining the RFC for SDP files, but after searching Google and all these forums, I can see the last 3 lines would tell the player to find the video stream on port 1234, and the encoding would be "MP2T". Not sure what "33" means, but if I was a player, I think I would expect the SDP file to tell me how to open the container, references to the streams in it and the codecs I would have to use for each, and maybe where to find them or the mux format. This is exactly what I saw in other posts (http://mailman.videolan.org/pipermail/v ... 07344.html):

Code: Select all

m=audio 1234 RTP/AVP 14 a=rtpmap:14 MPA/90000 m=video 1236 RTP/AVP 96 a=rtpmap:96 MP4V-ES/90000 a=fmtp:96 profile-level-id=3; config=00000100010000010509030000010000000100000408000D08000D0F040804030000010206060D000507000E040E080204060800000F
so I thought: maybe I can force audio and video to be on separate ports, so VLC would generate a more comprehensive SDP: wrong !

Code: Select all

:sout=#transcode{vcodec=mp4v,vb=800,fps=15,scale=1,acodec=mp4a,ab=64,channels=1}:rtp{mux=ts,dst=239.255.0.1,port-audio=1234,port-video=1236,ttl=6,name="Live transmission",sdp=file://c:/conference.sdp}
would give:

Code: Select all

m=video 5004 RTP/AVP 33 b=RR:0 a=rtpmap:33 MP2T/90000
and everything else the same.

Itried to create my own SDP file, to load into players manually, but this is obviously not the right way. VLC should create a working SDP file right away the first time. I have seen that some people have also asked for SDP-related issue, trying to see how to manually create it (no useful answers, if any), but I've found that in VLC, you really need to know the command line order, allowable options mix and syntax to make it fly.

Can you please let me know what the right parameters and order would be, to get VLC create a good and working SDP file for the streams above ?
I think clarifying this would solve many cases already open in the forums.

Cheers !

Ricardo

Re: Multicasting and SDP file

Posted: 21 Jul 2009 16:06
by vlcvn
i'm too. can you help me?
thanks.

Re: Multicasting and SDP file

Posted: 03 Jun 2010 08:36
by Incarnate
Hi,
I spotted this post and saw it was a while back.

Has either of you got any leads on the parameters in sdp files.
I'm trying to understand and enforce a certain 'config' for my video.

@ Helium you've got this as an output.
a=fmtp:96 profile-level-id=3;
config=00000100010000010509030000010000000100000408000D08000D0F040804030000010206060D000507000E040E080204060800000F

I'd like to find a way to get a specific config number.
Even an idea about what it is and how its generated would be useful.

Thanks

Re: Multicasting and SDP file

Posted: 03 Jun 2010 20:08
by Rémi Denis-Courmont
You can't. VLC always figures out the correct parameters.