number of actual frame

Jason Gerard DeRose jderose at novacut.com
Thu Apr 5 06:03:10 PDT 2012


On Thu, Apr 5, 2012 at 6:42 AM, padam <skaromana at wp.pl> wrote:

> Hi, this is my first post. I have to say, that my english isn't well, so
> you
> have to forgive me.
>
> So, i am writing a little application in C using Gstreamer, but i don't
> know
> how to get information about actual frame. I should be able to check that,
> when i'm watching movie or listening mp3, or other formats. Another problem
> is that i would like to get to concrete frame. For example i paused a
> movie,
> i check that i'm in 200 frame (it don't have to be keyframe) and i want to
> tell app that i want to get to 198 frame.
>

GStreamer (generally) deals with everything in terms of nanoseconds. So in
theory, all you need is the video's framerate, and then you can create a
seek event corresponding to an exact frame, or you can figure out what
frame corresponds to a buffer's timestamp.

In practice, how well this works depends on properties of the container
format, and the overall correctness of all the GStreamer plugins involved.
In my quest for frame accuracy, I've only extensively tested MOV (H.264
video) files from Canon DSLR cameras... but luckily enough, GStreamer
deliverers flawless frame-accuracy with this files (well, after I fixed a
goof or two in my math).

Note the conversion from nanoseconds to frame is a bit trickier as you'll
have to correctly round a floating point value to the nearest integer. You
can see how I did both directions in Python here:

http://bazaar.launchpad.net/~novacut/novacut/trunk/view/head:/novacut-thumbnailer#L64

Anyway, I'm totally obsessed with frame-accuracy, so never hesitate to
pester me with questions... and I'd love to hear what kind of results you
get with the types of video you're working with. I haven't yet done serious
tests for the audio equivalent, sample accurate seeking, so I have no idea
how well things work there.


> I don't know what to do. i thinking about it over few days, and i can't
> come
> up with any idea.
> Please for help.
>
> --
> View this message in context:
> http://gstreamer-devel.966125.n4.nabble.com/number-of-actual-frame-tp4534716p4534716.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20120405/9210da77/attachment.htm>


More information about the gstreamer-devel mailing list