[Libav-user] Seeking, timestamps, AVFrame, AVStream

James Board jpboard2 at yahoo.com
Sun Sep 15 23:37:41 CEST 2013


I'm writing a libAV application in C, and I'm trying to use the
av_seek_frame() or avformatseek_file() to move within the video stream.
Ideally, I'd like to seek to frame number N.  I'd like a subroutine that seeks
to frame number N, but I think from previous discussions, that isn't the way
things are done in ffmpeg and libav.  Okay.

I'm trying to understand how things actually are done in ffmpeg/libav.  When
decoding a video file (all my files, for now, are AVI containers with no
compression, or ffvhuff compression), the AVFrame struct has several members:
    pts
    pkt_pts
    pkt_dts
    coded_picture_number
    display_picture_number
    best_effort_timestamp (the name of this one really worries me)
    pkt_pos
    pkt_duration
What do those all mean?  Can I use those to figure out which frame this is?


Also, AVStream has some members:
    pts (has 3 components)
    timebase (2 components)
    start_time
    duration
What do they mean?

I have test code and the only thing that seems useful to me is that pkt_pos
seems to increase by a very large value for each frame (over 4 million) and the it
is usually the same difference between two frames, but not always.

Anyway, can someone tell me what the above struct members mean, and how I can
use them to tell where each frame is in the overall video file?  Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20130915/63cc2144/attachment.html>


More information about the Libav-user mailing list