Write stream to file and play it simultaneously.

Sebastian Dröge sebastian at centricular.com
Fri Dec 13 10:52:39 PST 2013


On Mo, 2013-12-09 at 14:42 +0400, Ilya Averyanov wrote:
> I try to save and play h264 rtp stream simultaneously.
> 
> In 0.10 version i use 
> gst-launch-0.10 udpsrc port=3000 ! 'application/x-rtp,
> sprop-parameter-sets=(string)'\"Z2QAKK2EBUViuKxUdCAqKxXFYqOhAVFYrisVHQgKisVxWKjoQFRWK4rFR0ICorFcVio6ECSFITk8nyfk/k/J8nm5s00IEkKQnJ5Pk/J/J+T5PNzZprQCgC3I\\,aO48sA\\=\\=\"', payload=(int)96' ! rtph264depay ! tee name=t ! h264parse ! matroskamux  ! filesink location=tmp.mkv t. ! queue max-size-buffers=0 max-size-bytes=0 max-size-time=0 ! ffdec_h264  ! autovideosink
> 
> this pipeline and it's work fine.
> 
> But if i try use 1.0 version with this pipleine
> gst-launch-1.0 udpsrc port=3000 ! 'application/x-rtp,
> sprop-parameter-sets=(string)'\"Z2QAKK2EBUViuKxUdCAqKxXFYqOhAVFYrisVHQgKisVxWKjoQFRWK4rFR0ICorFcVio6ECSFITk8nyfk/k/J8nm5s00IEkKQnJ5Pk/J/J+T5PNzZprQCgC3I\\,aO48sA\\=\\=\"', payload=(int)96' ! rtph264depay ! tee name=t ! h264parse ! matroskamux ! filesink location=tmp.mkv t. ! queue max-size-buffers=0 max-size-bytes=0 max-size-time=0 ! avdec_h264  ! autovideosink
> 
> i get nothing.

What do you mean with "you get nothing"? Does it work if you just try to
display the video (and drop the tee and the filesink branch)?

Which version of 1.x are you using?

Also you should add a queue after *both* srcpads of the tee element. In
front of the h264parse it is missing. And adding another h264parse in
front of avdec_h264 would probably be a good idea too, same for a
videoconvert between the sink and the decoder.

> I also try just save stream with 1.0 version.
> 
> Using 
> gst-launch-1.0 udpsrc port=3000 ! 'application/x-rtp,
> sprop-parameter-sets=(string)'\"Z2QAKK2EBUViuKxUdCAqKxXFYqOhAVFYrisVHQgKisVxWKjoQFRWK4rFR0ICorFcVio6ECSFITk8nyfk/k/J8nm5s00IEkKQnJ5Pk/J/J+T5PNzZprQCgC3I\\,aO48sA\\=\\=\"', payload=(int)96' ! rtph264depay ! tee name=t ! h264parse ! matroskamux ! filesink location=tmp.mkv
> 
> File writing and have correct size, but i can't play it.

What happens when you play it, what errors do you get? Can you provide
such a file?

> If change matroskamux to avimux i get this error:
> 
> ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal
> data flow error.
> Additional debug info:
> gstbasesrc.c(2865): gst_base_src_loop
> (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
> streaming task paused, reason not-negotiated (-4)
> Execution ended after 0:00:00.043653442

For this, get debug logs with debug level 6, search for the first time
the string "not-negotiated" appears and from there on look backwards in
the log to see why avimux does not accept the h264 stream. There will be
something about incompatible caps somewhere most likely, or some output
from avimux.

-- 
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131213/ab7d14ea/attachment.pgp>


More information about the gstreamer-devel mailing list