Problem with recording video and displaying at the same time

classic Classic list List threaded Threaded
2 messages Options
Zyx
Reply | Threaded
Open this post in threaded view
|

Problem with recording video and displaying at the same time

Zyx
Hi,

I am receiving a video from udp port. I wanted to save it in a file and at the same time display it on the screen. When I do this separately it works just fine:

gst-launch-1.0 -e -v udpsrc port=5000 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! h264parse ! omxh264dec ! ximagesink sync=false

and for recording:
gst-launch-1.0 -e -v udpsrc port=5000 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! h264parse ! matroskamux ! filesink sync=false location='/home/pi/recorded/test.mkv'

But when I do this using one command like this:
gst-launch-1.0 -e -v udpsrc port=5000 ! application/x-rtp, payload=96 ! rtpjitterbuffer ! rtph264depay ! h264parse ! tee name=t ! queue matroskamux ! filesink sync=false location='/home/pi/recorded/test.mkv' t. ! queue ! omxh264dec ! ximagesink sync=false

I've got internal data flow error:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "application/x-rtp\,\ payload\=\(int\)96\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"
/GstPipeline:pipeline0/GstRtpJitterBuffer:rtpjitterbuffer0.GstPad:src: caps = "application/x-rtp\,\ payload\=\(int\)96\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:src: caps = "video/x-h264\,\ stream-format\=\(string\)byte-stream\,\ alignment\=\(string\)nal"
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:sink: caps = "application/x-rtp\,\ payload\=\(int\)96\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"
/GstPipeline:pipeline0/GstRtpJitterBuffer:rtpjitterbuffer0.GstPad:sink: caps = "application/x-rtp\,\ payload\=\(int\)96\,\ media\=\(string\)video\,\ clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2933): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming task paused, reason not-negotiated (-4)
EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...

Does anyone have an idea what is wrong?
Reply | Threaded
Open this post in threaded view
|

Re: Problem with recording video and displaying at the same time

Dimitrios Katsaros
You are missing an exclamation point here: "tee name=t ! queue <!> matroskamux" in your post. I will assume that that was a typo when you were writing the e-mail.

Check the sink caps of omxh264dec and matroskamux. I don't have the omx plugins available on my setup so I can't verify this, but it is possible that the two elements expect different variants of h264. If this is the case you should use 2 h264parses after the tee to provide the correct format to both. Also, avoid using sync=0, this can cause reduced quality for your video output. You should increase the latency on the pipeline or, if youa re using gst-launch, you can try increasing the "ts-offset" parameter in ximagesink

Dimitrios


On Wed, Feb 8, 2017 at 9:47 AM, Zyx <[hidden email]> wrote:
Hi,

I am receiving a video from udp port. I wanted to save it in a file and at
the same time display it on the screen. When I do this separately it works
just fine:

gst-launch-1.0 -e -v udpsrc port=5000 ! application/x-rtp, payload=96 !
rtpjitterbuffer ! rtph264depay ! h264parse ! omxh264dec ! ximagesink
sync=false

and for recording:
gst-launch-1.0 -e -v udpsrc port=5000 ! application/x-rtp, payload=96 !
rtpjitterbuffer ! rtph264depay ! h264parse ! matroskamux ! filesink
sync=false location='/home/pi/recorded/test.mkv'

But when I do this using one command like this:
gst-launch-1.0 -e -v udpsrc port=5000 ! application/x-rtp, payload=96 !
rtpjitterbuffer ! rtph264depay ! h264parse ! tee name=t ! queue matroskamux
! filesink sync=false location='/home/pi/recorded/test.mkv' t. ! queue !
omxh264dec ! ximagesink sync=false

I've got internal data flow error:

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps =
"application/x-rtp\,\ payload\=\(int\)96\,\ media\=\(string\)video\,\
clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"
/GstPipeline:pipeline0/GstRtpJitterBuffer:rtpjitterbuffer0.GstPad:src: caps
= "application/x-rtp\,\ payload\=\(int\)96\,\ media\=\(string\)video\,\
clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:src: caps =
"video/x-h264\,\ stream-format\=\(string\)byte-stream\,\
alignment\=\(string\)nal"
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:sink: caps =
"application/x-rtp\,\ payload\=\(int\)96\,\ media\=\(string\)video\,\
clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"
/GstPipeline:pipeline0/GstRtpJitterBuffer:rtpjitterbuffer0.GstPad:sink: caps
= "application/x-rtp\,\ payload\=\(int\)96\,\ media\=\(string\)video\,\
clock-rate\=\(int\)90000\,\ encoding-name\=\(string\)H264"
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data
flow error.
Additional debug info:
gstbasesrc.c(2933): gst_base_src_loop ():
/GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming task paused, reason not-negotiated (-4)
EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...

Does anyone have an idea what is wrong?



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Problem-with-recording-video-and-displaying-at-the-same-time-tp4681757.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel