[FFmpeg-devel] [PATCH] lavfi: add duration field to AVFilterBufferRef

Nicolas George nicolas.george at normalesup.org
Tue Jul 31 15:05:42 CEST 2012


Le quartidi 14 thermidor, an CCXX, Stefano Sabatini a écrit :
> Uh, why? Expressions which only relies on the pts won't be affected by
> the duration.

Yes, but duration is affected by frame selection: if the expression keeps,
for example, one frame out of three, the duration must be multiplied by
three too.

The same problem goes for setpts; it could evaluate the expression at
PTS+duration, but that only works if the expression does not have side
effects.

> The current problem is that we lack the duration information, in case
> of an ending stream we only have the last frame PTS, and the only way
> to compute the duration of the last frame is by guessing.

That is absolutely true, but there would be other solutions to solve that.
For example a dummy last frame.

>							    Also we
> can't always assume *continuous* streams, we could have gaps inside a
> video stream and with the current information we have no way to detect
> them.

True.

> If case of duration / next timestamp inconsistency, they should be
> addressed by each single filter. I expect that most filters will only
> rely on the pts information, and we can fix the duration/pts
> information with the setpts filter (and asetpts, which we still miss).

That may work, but I am not entirely sure it will not make the burden
higher.

> Same semantic as the pkt_duration field in AVFrame, a duration of 0
> means unspecified, a negative value should be regarded as invalid
> (unless we have some use for a negative duration??). I'll update the
> patch accordingly.

Clément had expressed concerns with that convention: there may be situations
where duration=0 makes senses. I do not remember the specifics,
unfortunately.

Regards,

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


More information about the ffmpeg-devel mailing list