Step mp4 grabbing frames with appsink
jreilly
john.reilly66 at gmail.com
Wed Aug 24 12:29:13 UTC 2016
I'm trying to write a gst 1.8.2 application on Windows 7 using wxWidgets that
opens an mp4 and shows a single frame. The user can then click a button to
move forward by n seconds.
I created this pipeline
uridecodebin uri=file:/c:/myVideo.mp4 ! queue ! appsink name=app
with gst_parse_launch(). I set the pipeline state to paused. I was then able
to grab frames on command using gst_app_sink_pull_preroll(), and step by
sending the step event. All this is being done on the main UI thread event
loop. This works fine for some videos.
I have come across some videos where this does not work. It hangs forever
trying to pull the preroll. These videos do play using gstreamer, vlc, and
windows media player.
So I have tried re-architecting by setting the appsink callbacks. I am still
setting the pipeline state to paused, and using the second video sample I
get the first frame in the appsink new sample callback, but my callbacks
never get called after the subsequent step events. Using my first video
sample, I don't get any appsink new sample callbacks, but I get a single
appsink new preroll callback for the first frame, and still nothing after
the step events.
I thought about setting the pipeline briefly to playing, and maybe that
would break something lose. But if I try to set the pipeline state back to
paused in the appsink callbacks, the set state call never returns (i.e.
blocks).
[Background: for my application, we are capturing streaming video from
multiple IR cameras, and then we need to identify stills in the stream, and
save those stills to files for analysis.]
It seems to me that this is a common workflow, and someone will know what
I'm doing wrong.
Thanks for any hints.
-reilly.
--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Step-mp4-grabbing-frames-with-appsink-tp4679227.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
More information about the gstreamer-devel
mailing list