Page 1 of 1

Problem with SDP file when using MP3 codec?

Posted: 03 Nov 2008 09:14
by simonb
Summary:
The SDP file produced when I select an MP3 codec appears to be broken resulting in a silent playback via a Wowza/Flash streaming server and client.
MP4 codec produces the following output in the SDP file.

Code: Select all

a=rtpmap:97 mpeg4-generic/44100/2 a=fmtp:97 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=0a10; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;
MP3 codec produces the following output in the SDP file.

Code: Select all

a=rtpmap:14 MPA/90000/2
So do we have a 90000 sample rate here? Shouldn't there be more information? Doens't MPA imply MP1 layer 2 and not MP1 layer 3?

Detail:

The following command line produces an SDP file that works fine for feeding a Wowza streaming server for Flash clients (using Flowplayer).

Code: Select all

vlc v4l2:// :v4l2-dev=/dev/video0 :v4l2-input=1 :v4l2-io=1 :v4l2-width=720 :v4l2-height=576 :v4l2-adev=hw:0,0 :v4l2-audio-method=3 :v4l2-stereo :v4l2-samplerate=44100 :v4l2-tuner=0: v4l2-tuner-audio-mode=1 :v4l2-controls-reset :v4l2-auto-white-balance=1 :v4l2-autogain=1 :no-v4l2-audio-mute --v4l2-set-ctrls={chroma agc=1,combfilter=1} --sout '#duplicate{dst="transcode{threads=4,width=640,height=480,venc=x264,fps=25,vcodec=x264,vb=300,deinterlace=linear,acodec=mp4a,ab=96,channels=2,samplerate=44100}:duplicate{dst=rtp{dst=192.168.0.18,port-video=10000,port-audio=10002,sdp=file:///tmp/playthis.sdp},dst=std{access=file, mux=ts, dst=/tmp/playthis.mpeg}}"}' --sout-x264-ref=5
Here is the SDP file it produces.

Code: Select all

v=0 o=- 14751873074713056480 14751873074713056480 IN IP4 localhost s=Unnamed i=N/A c=IN IP4 192.168.0.18 t=0 0 a=tool:vlc 0.9.5 a=recvonly a=type:broadcast a=charset:UTF-8 m=video 10000 RTP/AVP 96 b=AS:300 b=RR:0 a=rtpmap:96 H264/90000 a=fmtp:96 packetization-mode=1;profile-level-id=4d4033;sprop-parameter-sets=Z01AM5pzAUB7YCIAAAMAAgAAAwBlHjBk0A==,aO48gA==; m=audio 10002 RTP/AVP 97 b=AS:96 b=RR:0 a=rtpmap:97 mpeg4-generic/44100/2 a=fmtp:97 streamtype=5; profile-level-id=15; mode=AAC-hbr; config=0a10; SizeLength=13; IndexLength=3; IndexDeltaLength=3; Profile=1;
I change the command line to use and MP3 codec instead by just changing the acodec setting the transcode statement. The command line now looks like this...

Code: Select all

vlc v4l2:// :v4l2-dev=/dev/video0 :v4l2-input=1 :v4l2-io=1 :v4l2-width=720 :v4l2-height=576 :v4l2-adev=hw:0,0 :v4l2-audio-method=3 :v4l2-stereo :v4l2-samplerate=44100 :v4l2-tuner=0: v4l2-tuner-audio-mode=1 :v4l2-controls-reset :v4l2-auto-white-balance=1 :v4l2-autogain=1 :no-v4l2-audio-mute --v4l2-set-ctrls={chroma agc=1,combfilter=1} --sout '#duplicate{dst="transcode{threads=4,width=640,height=480,venc=x264,fps=25,vcodec=x264,vb=300,deinterlace=linear,acodec=mp3,ab=96,channels=2,samplerate=44100}:duplicate{dst=rtp{dst=192.168.0.18,port-video=10000,port-audio=10002,sdp=file:///tmp/playthis.sdp},dst=std{access=file, mux=ts, dst=/tmp/playthis.mpeg}}"}' --sout-x264-ref=5
And the resulting SDP file looks like this...

Code: Select all

v=0 o=- 14751874343142510294 14751874343142510294 IN IP4 localhost s=Unnamed i=N/A c=IN IP4 192.168.0.18 t=0 0 a=tool:vlc 0.9.5 a=recvonly a=type:broadcast a=charset:UTF-8 m=video 10000 RTP/AVP 96 b=AS:300 b=RR:0 a=rtpmap:96 H264/90000 a=fmtp:96 packetization-mode=1;profile-level-id=4d4033;sprop-parameter-sets=Z01AM5pzAUB7YCIAAAMAAgAAAwBlHjBk0A==,aO48gA==; m=audio 10002 RTP/AVP 14 b=AS:96 b=RR:0 a=rtpmap:14 MPA/90000/2
The command line also saves the stream to disk. The audio is fine on the disk based recording. It is only streaming that doesn't work.

Re: Problem with SDP file when using MP3 codec?

Posted: 03 Nov 2008 10:37
by Jean-Baptiste Kempf
Can you put MP3 audio over RTP like this ?

Re: Problem with SDP file when using MP3 codec?

Posted: 03 Nov 2008 10:58
by simonb
Can you put MP3 audio over RTP like this ?
Just done a quick Google and it appears that you can. It is described as "MPA".
http://www.dmn.tzi.org/ietf/mmusic/54/s ... -video.ppt

Re: Problem with SDP file when using MP3 codec?

Posted: 03 Nov 2008 11:20
by Jean-Baptiste Kempf
Does VLC supports it ? Ask on the IRC...

Re: Problem with SDP file when using MP3 codec?

Posted: 03 Nov 2008 17:43
by RĂ©mi Denis-Courmont
MP3 codec produces the following output in the SDP file.

Code: Select all

a=rtpmap:14 MPA/90000/2
So do we have a 90000 sample rate here? Shouldn't there be more information? Doens't MPA imply MP1 layer 2 and not MP1 layer 3?
MPA means MPEG Audio. Any layer. 90000 refers to the RTP timestamps frequency, not the audio sampling here. This value is mandated by IETF RFC2038, and consistent with the MPEG clock frequency.

To the best of knowledge, VLC output is correct here.

Re: Problem with SDP file when using MP3 codec?

Posted: 04 Nov 2008 11:04
by simonb
OK. Thanks for shedding some light on this. That was most helpful. It looks like I was barking up the wrong tree.

Next step for me is to test an RTP/SDP feed from VLC to another client than the Wowza server and see if that works.