[FFmpeg-user] Some questions about PTS

Edward Park kumowoon1025 at gmail.com
Fri Aug 28 12:25:59 EEST 2020


I am not confident about this info but I've always thought the timebase is usually the reciprocal of the framerate *or smaller*. As in, the duration of a frame can be represented accurately enough as the difference between the timestamps, which aren't counted using seconds, but "ticks" in whatever timebase. So smaller fractions could be used as the timebase as long as the system is capable, and on the other hand, when you create low-fps video like 4fps, obviously the timebase isn't going to be 1/4, it'll probably have the same timebase as any other export. (I think of it as an analog wall clock, except it doesn't go tick-tock every second, it goes tick-tock every 1/90000 seconds.)

Actually, I think for the codec timebase, it is more common for it to be 1/2 the reciprocal of the frame rate; if that's codec-specific, I don't know why that is. Maybe you've also seen some setpts examples where you divide/multiply something by 2 for some arcane reason? Hopefully someone can explain further..

When you delay some frames by whatever amount, it necessarily effects a change in the frame rate (but not the timebase). I'm not sure where the FR value for setpts comes from, maybe it wouldn't matter if it stays the same as the nominal framerate if indicated by the media, but if it is something that can change, maybe the effective rate at the end of the chain, obviously it wouldn't work as expected.

Just for the sake of curiosity, what has you looking to delay frames using setpts? I feel there are easier methods.

Ted Park

More information about the ffmpeg-user mailing list