Hi guys,
Right now I have working gstreamer with Wowza successfully with H264 and AAC for flash clients and Iphone clients.
The following pipelines are working nice for me.
gst-launch-0.10 -v videotestsrc ! "video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)15/1" ! queue ! x264enc bitrate=500 cabac=false pass=qual quantizer=27 subme=4 threads=0 bframes=0 dct8x8=false ! queue ! rtph264pay ! queue ! udpsink host=127.0.0.1 port=50000
gst-launch-0.10 -v audiotestsrc ! "audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2" ! queue ! tee name=audio audio. ! queue ! faac ! queue ! rtpmp4gpay ! queue ! udpsink host=127.0.0.1 port=50002
You can also run both together at the same time:
gst-launch-0.10 -v videotestsrc ! "video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)15/1" ! queue ! x264enc bitrate=500 cabac=false pass=qual quantizer=27 subme=4 threads=0 bframes=0 dct8x8=false ! queue ! rtph264pay ! queue ! udpsink host=127.0.0.1 port=50000 audiotestsrc ! "audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2" ! queue ! tee name=audio audio. ! queue ! faac ! queue ! rtpmp4gpay ! queue ! udpsink host=127.0.0.1
port=50002
This is the sdp file that I’m using for this pipelines:
v=0
o=- 1208520720 2590316915 IN IP4 127.0.0.1
s=MY FIRST PIPELINE
i=N/A
c=IN IP4 127.0.0.1
t=0 0
m=video 50000 RTP/AVP 96
a=rtpmap:96 H264/90000
a=fmtp:96 media=video; clock-rate=90000; encoding-name=H264; profile-level-id=4d4015; sprop-parameter-sets=Z01AFbkQOhH3EYCIAAADAAgAAAMA9HixdQ==,aO48gA==
a=control:trackID=1
m=audio 50002 RTP/AVP 96
a=rtpmap:96 MPEG4-GENERIC/48000/2
a=fmtp:96 media=audio; clock-rate=48000; encoding-name=MPEG4-GENERIC; encoding-params=2; streamtype=5; profile-level-id=1; mode=AAC-hbr; config=0990; sizeLength=13; indexLength=3; indexDeltaLength=3; payload=96
a=control:trackID=2
It’s very important to notice that every different compilation of gstreamer has very different caps even for the same version. I mean, if you are using a different x264 library you will get different caps on your gstreamer pipeline outoput. This means that you need to update your sdp file with the caps from your gstreamer output. MAKE SURE YOU USE THE -v OPTION ON YOUR PIPELINES TO GET THESE CAPS.
““NOTE: I’'VE REMOVED SOME OUTPUT BECAUSE THERE IS A TEXT LIMITATION.””
For example, the caps for the previous pipelines are (it’s likely that the following caps and my previous sdp file doesn’t match because it’s from a different box):
Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, framerate=(fraction)15/1
/GstPipeline:pipeline0/GstAudioTestSrc:audiotestsrc0.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2
Pipeline is PREROLLING ...
..................
/GstPipeline:pipeline0/GstQueue:queue3.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2
/GstPipeline:pipeline0/GstTee:audio.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2
/GstPipeline:pipeline0/GstTee:audio.GstPad:src0: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2
/GstPipeline:pipeline0/GstTee:audio.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2
/GstPipeline:pipeline0/GstQueue:queue4.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2
/GstPipeline:pipeline0/GstQueue:queue4.GstPad:src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2
/GstPipeline:pipeline0/GstFaac:faac0.GstPad:sink: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2
/GstPipeline:pipeline0/GstFaac:faac0.GstPad:src: caps = audio/mpeg, mpegversion=(int)4, channels=(int)2, rate=(int)48000, codec_data=(buffer)0990
/GstPipeline:pipeline0/GstQueue:queue5.GstPad:sink: caps = audio/mpeg, mpegversion=(int)4, channels=(int)2, rate=(int)48000, codec_data=(buffer)0990
/GstPipeline:pipeline0/GstQueue:queue5.GstPad:src: caps = audio/mpeg, mpegversion=(int)4, channels=(int)2, rate=(int)48000, codec_data=(buffer)0990
/GstPipeline:pipeline0/GstRtpMP4GPay:rtpmp4gpay0.GstPad:src: caps = application/x-rtp, media=(string)audio, clock-rate=(int)48000, encoding-name=(string)MPEG4-GENERIC, encoding-params=(string)2, streamtype=(string)5, profile-level-id=(string)1, mode=(string)AAC-hbr, config=(string)0990, sizelength=(string)13, indexlength=(string)3, indexdeltalength=(string)3, payload=(int)96, ssrc=(guint)3072717366, clock-base=(guint)2502145401, seqnum-base=(guint)57789
/GstPipeline:pipeline0/GstRtpMP4GPay:rtpmp4gpay0.GstPad:sink: caps = audio/mpeg, mpegversion=(int)4, channels=(int)2, rate=(int)48000, codec_data=(buffer)0990
/GstPipeline:pipeline0/GstQueue:queue6.GstPad:sink: caps = application/x-rtp, media=(string)audio, clock-rate=(int)48000, encoding-name=(string)MPEG4-GENERIC, encoding-params=(string)2, streamtype=(string)5, profile-level-id=(string)1, mode=(string)AAC-hbr, config=(string)0990, sizelength=(string)13, indexlength=(string)3, indexdeltalength=(string)3, payload=(int)96, ssrc=(guint)3072717366, clock-base=(guint)2502145401, seqnum-base=(guint)57789
/GstPipeline:pipeline0/GstQueue:queue6.GstPad:src: caps = application/x-rtp, media=(string)audio, clock-rate=(int)48000, encoding-name=(string)MPEG4-GENERIC, encoding-params=(string)2, streamtype=(string)5, profile-level-id=(string)1, mode=(string)AAC-hbr, config=(string)0990, sizelength=(string)13, indexlength=(string)3, indexdeltalength=(string)3, payload=(int)96, ssrc=(guint)3072717366, clock-base=(guint)2502145401, seqnum-base=(guint)57789
[B]/GstPipeline:pipeline0/GstUDPSink:udpsink1.GstPad:sink: caps = application/x-rtp, media=(string)audio, clock-rate=(int)48000, encoding-name=(string)MPEG4-GENERIC, encoding-params=(string)2, streamtype=(string)5, profile-level-id=(string)1, mode=(string)AAC-hbr, config=(string)0990, sizelength=(string)13, indexlength=(string)3, indexdeltalength=(string)3, payload=(int)96, ssrc=(guint)3072717366, clock-base=(guint)2502145401, seqnum-base=(guint)57789[/B]
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:sink: caps = video/x-h264, width=(int)640, height=(int)480, framerate=(fraction)15/1, codec_data=(buffer)0142c016ffe100186742c016b9101407b60220000003002000000303d1e2c5d401000468ce1720
/GstPipeline:pipeline0/GstQueue:queue1.GstPad:src: caps = video/x-h264, width=(int)640, height=(int)480, framerate=(fraction)15/1, codec_data=(buffer)0142c016ffe100186742c016b9101407b60220000003002000000303d1e2c5d401000468ce1720
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, profile-level-id=(string)42c016, sprop-parameter-sets=(string)\"Z0LAFrkQFAe2AiAAAAMAIAAAAwPR4sXU\\,aM4XIA\\=\\=\", payload=(int)96, ssrc=(guint)1090311487, clock-base=(guint)3529879298, seqnum-base=(guint)18909
/GstPipeline:pipeline0/GstRtpH264Pay:rtph264pay0.GstPad:sink: caps = video/x-h264, width=(int)640, height=(int)480, framerate=(fraction)15/1, codec_data=(buffer)0142c016ffe100186742c016b9101407b60220000003002000000303d1e2c5d401000468ce1720
/GstPipeline:pipeline0/GstQueue:queue2.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, profile-level-id=(string)42c016, sprop-parameter-sets=(string)\"Z0LAFrkQFAe2AiAAAAMAIAAAAwPR4sXU\\,aM4XIA\\=\\=\", payload=(int)96, ssrc=(guint)1090311487, clock-base=(guint)3529879298, seqnum-base=(guint)18909
/GstPipeline:pipeline0/GstQueue:queue2.GstPad:src: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, profile-level-id=(string)42c016, sprop-parameter-sets=(string)\"Z0LAFrkQFAe2AiAAAAMAIAAAAwPR4sXU\\,aM4XIA\\=\\=\", payload=(int)96, ssrc=(guint)1090311487, clock-base=(guint)3529879298, seqnum-base=(guint)18909
[B]/GstPipeline:pipeline0/GstUDPSink:udpsink0.GstPad:sink: caps = application/x-rtp, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264, profile-level-id=(string)42c016, sprop-parameter-sets=(string)\"Z0LAFrkQFAe2AiAAAAMAIAAAAwPR4sXU\\,aM4XIA\\=\\=\", payload=(int)96, ssrc=(guint)1090311487, clock-base=(guint)3529879298, seqnum-base=(guint)18909
[/B]Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
The last (bolth) lines of each media type (audio and video) are the final caps that you need to include on the sdp file.
Finally notice that on relation to the video caps for x264 (concretely the sprop-parameter-sets) have on the command line caps different backslash that should be removed on the sdp file. For example from the previous caps:
sprop-parameter-sets=(string)“Z0LAFrkQFAe2AiAAAAMAIAAAAwPR4sXU\,aM4XIA\=\=”
should end on the sdp file like:
Z0LAFrkQFAe2AiAAAAMAIAAAAwPR4sXU,aM4XIA==
I hope this would help someone.
Thank you.