[FFmpeg-devel] [PATCH] ffmpeg: fail on experimental encoders if -strict > experimental

Baptiste Coudurier baptiste.coudurier
Wed May 26 02:15:50 CEST 2010


On 05/25/2010 05:08 PM, Michael Niedermayer wrote:
> On Wed, May 26, 2010 at 12:48:00AM +0200, Janne Grunau wrote:
>> Hi,
>>
>> not sure if I'm abusing -strict too much. Even the exprimental encoders should
>> produce standard compliant output.
>>
>> Depends on the CODEC_CAP_EXPERIMENTAL patch
>>
>> Janne
>
>>   ffmpeg.c |   23 ++++++++++++++++-------
>>   1 file changed, 16 insertions(+), 7 deletions(-)
>> e735ba4cec8890f65607e89198e4ed9859e91469  ffmpeg_fail_on_experimental_encoders.diff
>> commit f7be47f7a94abe9a5a318034ea932b35eee37e7a
>> Author: Janne Grunau<janne at grunau.be>
>> Date:   Mon May 24 23:15:19 2010 +0200
>>
>>      ffmpeg: fail if encoder is experimental and -strict>  experimental
>>
>> diff --git a/ffmpeg.c b/ffmpeg.c
>> index 63f0e6b..6eb7aa9 100644
>> --- a/ffmpeg.c
>> +++ b/ffmpeg.c
>> @@ -3068,7 +3068,7 @@ static int opt_input_ts_offset(const char *opt, const char *arg)
>>       return 0;
>>   }
>>
>> -static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
>> +static enum CodecID find_codec_or_die(const char *name, int type, int encoder, int strict)
>>   {
>>       const char *codec_string = encoder ? "encoder" : "decoder";
>>       AVCodec *codec;
>> @@ -3086,6 +3086,12 @@ static enum CodecID find_codec_or_die(const char *name, int type, int encoder)
>>           fprintf(stderr, "Invalid %s type '%s'\n", codec_string, name);
>>           av_exit(1);
>>       }
>> +    if(codec->caps&  CODEC_CAP_EXPERIMENTAL&&  strict>  FF_COMPLIANCE_EXPERIMENTAL) {
>> +        fprintf(stderr, "%s \"%s\" is experimental and might produce bad "
>> +                "results. Add \"-strict experimental\" if you want to use it.\n",
>> +                codec_string, codec->name);
>> +        av_exit(1);
>> +    }
>>       return codec->id;

We might want to add a note for people using -acodec vorbis to use 
-acodec libvorbis.

I like the patch :)

-- 
Baptiste COUDURIER
Key fingerprint                 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA
FFmpeg maintainer                                  http://www.ffmpeg.org



More information about the ffmpeg-devel mailing list