[FFmpeg-devel] [PATCH 2/8] av1_metadata: Add option to update video parameters

Andreas Rheinhardt andreas.rheinhardt at googlemail.com
Sat Dec 1 22:57:00 EET 2018

James Almer:
> On 12/1/2018 4:28 PM, Andreas Rheinhardt wrote:
>> Up until now, this BSF only changed the bitstream, not the
>> AVCodecParameters. The result is that e.g. some muxers use outdated
>> information to write header information that conflicts with (and precedes)
>> the new information at the bitstream level, so that the updates might
>> not lead to the desired change.
>> This commit changes this. It adds a mechanism by which the new
>> information can be used to update the AVCodecParameters, too. This is
>> the new default and an option has been added to revert to the old
>> behaviour.
>> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at googlemail.com>
>> + at item full_update
>> +If this is set, the AVCodecParameters are updated in addition to the
>> +bitstream. If unset, muxers might add header information based upon the
>> +old AVCodecParameters that contradicts and potentially precedes the
>> +changes made at the bitstream level. On by default.
>> +
>> +    { "full_update", "Update not only bitstream, but also AVCodecParameters.",
>> +        OFFSET(full_update), AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, FLAGS},
> I don't think this needs an option. It should be the default behavior.
> The BSF framework is written in a way that changing AVCodecParameters
> values is expected (Or necessary, like in cases where it adds extradata).
My rationale was that these are bitstream filters; they are meant to change the bitstream, but with this new option, they can also lead to a change at the container level. Now most users will want to align the information of these two layers (and this is the reason that updating is the default behaviour), but there might be a niche case where this is not desired. So I added this option. But of course I don't insist on it and am fine with either way.

- Andreas

PS: If changing AVCodecParameters is expected, then how do I change the aspect ratio without breaking muxing?

More information about the ffmpeg-devel mailing list