Pause and resume live video with latest frames without affecting the sink

Antonio Ospite ao2 at ao2.it
Thu Aug 23 06:40:09 UTC 2018


On Wed, 22 Aug 2018 10:33:07 -0500 (CDT)
vk_gst <venkateshkuppan26 at gmail.com> wrote:

[...]
> I see I made a mistake here. I totally removed the identity element now. So
> the pipeline is 
> v4l2src -> queue -> h264parse ->avdec_h264 -> imagefreeze(dynamically
> added/removed) -> glupload -> glcolorconvert -> gltransformation ->
> glimagesink. 
> 
> With this pipeline, based on user input I add the imagefreeze element, and
> then I am able to apply gltransformation on the paused video frame.  For
> other input, I am removing the imagefreeze element from pipeline, and I hope
> to see the video replay again. But I observe the following error : 
> 
> 0:00:12.412324825 16939      0x2655b20 WARN             imagefreeze
> gstimagefreeze.c:851:gst_image_freeze_src_loop:<ifreeze> error: Internal
> data stream error.
> 0:00:12.412424980 16939      0x2655b20 WARN             imagefreeze
> gstimagefreeze.c:851:gst_image_freeze_src_loop:<ifreeze> error: streaming
> stopped, reason not-linked (-1)
> ERROR: ifreeze : Internal data stream error.
> debugging info: gstimagefreeze.c(851): gst_image_freeze_src_loop ():
> /GstPipeline:test-pipeline/GstImageFreeze:ifreeze:
> streaming stopped, reason not-linked (-1)
>
> While removing the element imagefreeze, 
> 1. I send a EOS event as sink pad of imagefreeze,
> 2.  unlink src and sink pads of avdec_h264 and upload,
> 3.  set state to NULL, 
> 4. link back avdec_h264 and upload.
>

How you link and unlink matters, are you following
https://coaxion.net/blog/2014/01/gstreamer-dynamic-pipelines/ ?

[...]
> >gst-launch-1.0 videotestsrc ! \
> >               identity drop-probability=1 ! \
> >               imagefreeze ! \
> >               videoconvert ! rotate angle=10 ! videoconvert ! \
> >               fpsdisplaysink
> 
> >With this pipeline:
> 
> >gst-launch-1.0 videotestsrc ! \
> >               identity drop-probability=1 ! \
> >               intervideosink intervideosrc ! \
> >               imagefreeze ! \
> >               videoconvert ! rotate angle=10 ! videoconvert ! \
> >               fpsdisplaysink
> 
> >The second one progresses (even though with drop-probability=1 set
> >from the beginning the last buffer is not passed to imagefreeze), while
> >the first one stalls.
> 
> I am not sure if I understand this 2 pipelines correctly.  I see no
> difference in the rendering video. Its complete black in both cases, and it
> should be since the identity has blocked the output. However in the second
> pipeline, the comments displayed after execution has an extra line :
> 'Pipeline is live and does not need PREROLL ...' . This is not seen when
> executing the first pipeline.
> 

On my system, the first pipeline results in a "transparent" (as in
wrongly rendered) window, while the second is an actual black background
with the text about the framerate on top. I guess the behavior can
depend on the actual videosink.

Ciao,
   Antonio

-- 
Antonio Ospite
https://ao2.it
https://twitter.com/ao2it

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?


More information about the gstreamer-devel mailing list