[FFmpeg-devel] Question about frame->pts, outlink->time_base, and outlink->frame_rate

Nicolas George george at nsup.org
Tue Jan 28 23:16:38 CET 2014

Le nonidi 9 pluviôse, an CCXXII, Nicholas Robbins a écrit :
> However, when the stream gets written to a file, it still has timebase
> 1/1000 and PTS's with gaps of 33, 34, 66 or 67. They aren't quite the same
> PTS's however. They vary by one or two sometimes. 

I suspect you are observing the treatments that ffmpeg performs on the
frames after the filtering phase (and after encoding): adjusting the time
base and possibly duplicating / dropping frames to account for the
constraints of the output format.

> So I tried changing some other things in config_out_props. I found that if
> I set outlink->frame_rate = av_make_q(1,0) it would still forget the new
> timebase, but it would use the new PTS's. Sort of. I found gaps of ~42
> which is the new gaps divided by 8.  Seems like it converted the new PTS's
> from the new time_base to the old one and save them.

AVFilterLink.frame_rate is used by ffmpeg to determine the output frame rate
it will advertise in the file header and possibly enforce if the format does
not support generic timestamps. For the filters, it is mostly informational.
You should set it to a relevant value if possible.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140128/4761b237/attachment.asc>

More information about the ffmpeg-devel mailing list