How to get the last frame of a video file ?

Sebastian Dröge sebastian at centricular.com
Sat Jan 25 02:41:32 PST 2014


On Sa, 2014-01-25 at 02:29 -0800, adrien_sch wrote:
> In my case, The video file duration is 60146000000, the frame duration :
> 41708398 and the last seekable position is 59893000000. 
> 
> So, 60146000000 - 59893000000 = 253000000 is about 6.06 times the frame
> duration. How can I calculate the last frame timecode ? 

This strongly depends on the accuracy of the duration in the container.
I think the most reliable way to get the very last frame is to catch the
frames from a pad probe in front of the sink. Seek to near the end, let
it run until EOS and always remember the last frame you saw. In the end
you'll definitely have the last frame.

-- 
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: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140125/3914ee0f/attachment.pgp>


More information about the gstreamer-devel mailing list