AppSink pull-preroll doesn't work on H.264 MP4 Videos
kbaker at camerabits.com
Fri Aug 4 17:01:42 UTC 2017
I have been working on a small program to extract frames from videos, basing my work on the 'snapshot' example code:
…adapting it to our needs. It works great for the great majority of video formats that I've tried, but H.264 encoded MP4 videos cause it to hang when emitting the 'pull-preroll' signal. I modified the code to instead call gst_app_sink_try_pull_preroll() and giving it a 15-second timeout, which eliminates the hang but does not produce a frame sample either.
Is this expected? Is there some way to work around this behavior?
In order to try and diagnose the problem I have played around with gst-launch-1.0 like so:
gst-launch-1.0 filesrc location=path/to/mp4 ! decodebin ! queue ! autovideoconvert ! pngenc ! filesink location="frame.png"
And it does produce an image correctly (it writes each frame of the video to the same image file though, and I do know that one can number the files if one wants to.) But I only want one frame at a particular time point in the video, so this isn't a good solution for us.
Thanks in advance,
Kirk A. Baker
Senior Software Engineer
Camera Bits, Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 801 bytes
Desc: Message signed with OpenPGP using GPGMail
More information about the gstreamer-devel