[FFmpeg-user] repeat a frame

Carl Eugen Hoyos ceffmpeg at gmail.com
Tue Mar 2 22:18:03 EET 2021

Am Di., 2. März 2021 um 20:51 Uhr schrieb Mark Filipak (ffmpeg)
<markfilipak at bog.us>:
> On 2021-03-02 13:31, Carl Eugen Hoyos wrote:
> > Am Di., 2. März 2021 um 17:50 Uhr schrieb Mark Filipak (ffmpeg)
> > <markfilipak at bog.us>:
> >>
> >> I've searched the docs one-by-one. I seek a simpler way to repeat a frame.
> >
> > Increase the frame rate, either with the fps filter or the ffmpeg option "-r".
> > They differ in their greediness and verbosity on the status line.
> Thank you, Carl Eugen, I have noted that reality.
> Since I've assumed that AVFrame *is* the format of the frames in the filter
> pipeline (and therefore int64_t), and based on an assumption that TB is
> also 64 bits, I've adopted TB = 1/(720000 ticks/s)...

timebase is not 64bit, I believe this was already mentioned.

> ...so, for a 24fps CFR INPUT to a 24fps CFR OUTPUT for example,

If your input is cfr and you want cfr output, there should be no reason to mess
with timestamps.

> ffmpeg -i INPUT -vf settb=expr=1/720000,setpts=N*30000...setpts=N/24/TB,fps=24 OUTPUT

In addition to above, note that setpts is rarely a good idea as it is supposed
to break A/V sync. Using the filter several times does not improve the

Perhaps you should go back several (dozen) steps:
You have already explained that you have little interest in becoming a
C programmer (which is 100% reasonable), you therefore should not
be interested in the internal representations of FFmpeg (no, you cannot
improve them: The people who have written this code most likely
understand analog video as good as you but they are light years
ahead of you concerning digital video).
It is possible you have found other bugs in FFmpeg (many exist and
you have already found two or three). If you want us to improve the
project, simply post the command line you tested including the
complete, uncut console output and explain what you don't like in
the output file.
(You would have avoided a lot of flames lately...)

The fact that you cannot force a timebase when writing to Matroska
is not a bug that you have to report.

Carl Eugen

More information about the ffmpeg-user mailing list