[FFmpeg-user] frame number question

Paul B Mahol onemda at gmail.com
Sun Dec 20 20:49:34 EET 2020


On Sun, Dec 20, 2020 at 12:03 AM Mark Filipak (ffmpeg) <markfilipak at bog.us>
wrote:

> For the developers:
> At what point are frame numbers assigned?
>

Libavfilter does not really care about frame numbers much.
It internally just count number of frames that get into filter and number
of frames that get out filter.


> I would guess: When they leave the decoder. Am I right?
>

Decoder also does not care of frame numbers.


>
> Example:
> If '-vf decimate' removes frame[(n+1)%5==2], are frames renumbered at that
> point or are the frames
> left as frame[0], frame[2], frame[3], frame[4], frame[5], frame[7],
> frame[8], frame[9], etc.
>
> If you prefer I discover this on my own, that's okay, but I don't know how
> to put the frame number
> (as text) into the frames so that when I frame-step through the video I
> can see the frame numbers.
> If you could help with that, I'm pretty sure I can take the rest of the
> needed steps on my own.
>

As mentioned above, each filter counts frame numbers from 0, and the frames
that goes out of filter are also starting from 0.
There are no gaps.

Each frame that is decoded/filtered have no count number assigned to them
at all.


More information about the ffmpeg-user mailing list