Le septidi 7 brumaire, an CCXXIV, John Stebbins a écrit :
> Sorry, I'm being dense.  I see what you mean.  The comment currently
> implies that if you explicitly set frame_rate to 1/0, nobody in the
> filter chain will modify it.  The code obviously does not do this and I
> see no attempt in the ffmpeg code to try to preserve 1/0 in any way. In
> addition, there are few filters or sources where you can explicitly set
> the frame_rate, and all of these with the exception of buffersrc require
> a valid framerate (i.e. they will not accept 1/0).
> 
> It seems easier to me to define 0/0 as the "unknown" value because this
> *is* preserved by the code as it currently stands.  There is no filter
> aside from filters that convert to a known constant frame_rate that will
> modify a value of 0/0.

Your proposal does not work because it does not distinguish "the frame rate
is not known, maybe there is not even one" from "this filter did not bother
setting the frame rate".

A lot of filters were written before the frame_rate field was added. Most of
them are simple one-in-one-out filters where the output frame rate is the
same as the input. Your proposal would require going all these adding the
copy explicitly. This would be annoying, and you rightfully did not do it.

The cleared value 0/0 means that the filter did not bother setting it. If
you assign it a different semantic, you create ambiguity and make the API
more fragile.

The convention chosen in FFmpeg is: if 0/0, that means the filter did not
bother to set it, then assume the simplest case and let the framework set
the value as the same as the input.

Regards,

-- 
  Nicolas George

Attachment: signature.asc
Description: Digital signature

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to