[FFmpeg-devel] [PATCH v2] lavu/avframe: add a time_base field
Marton Balint
cus at passwd.hu
Fri Nov 26 00:49:20 EET 2021
On Thu, 25 Nov 2021, Lynne wrote:
> This adds a time_base field (currently unused), analogue to the
> AVPacket.time_base field.
> This allows for API clients to exchange AVFrames directly, without
> needing to plumb extra data from sources via side mechanisms.
The objections raised before still stand I believe, and again, the main
concern is that the API user won't know when to use the packet or frame
timebase and when to use the frame/packet source timebase.
You write this in the doxy:
> Time base for the timestamps in this frame. May be 0, in which case the
> time_base from the frame source should be used.
One could easily think - based on this text alone - that every user of
avcodec_receive_frame should check if AVFrame->time_base is 0 to
calculate real PTS...
I'd be a lot more willing to accept this if you could document explicitly
that AVFrame->time_base (and AVPacket->time_base) is not used by the API
right now, and is similar to e.g. *opaque field. And later, if by using
some magic flag or new API or whatever it turns out to make sense to
actually use AVPacket/AVFrame time base, the doxy text can be extended
accordingly.
Regards,
Marton
More information about the ffmpeg-devel
mailing list