[FFmpeg-devel] [PATCH] move set_context_opts call for video encoders to fix ... (was: Re: strict experimental)

Janne Grunau janne-ffmpeg
Sat Sep 25 12:33:34 CEST 2010


On Sat, Sep 25, 2010 at 12:17:07PM +0200, Janne Grunau wrote:
> On Sat, Sep 25, 2010 at 04:32:36AM +0200, Michael Niedermayer wrote:
> > On Fri, Sep 24, 2010 at 02:10:40PM +0200, Janne Grunau wrote:
> > 
> > >  ffmpeg.c |    4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > 4e6c7aa083bcaa3a70f16436b9b2084781af4bcc  video_enc_earlier_set_context_opts.diff
> > > commit 7240aadf429855433e641843b85198cfd5981a95
> > > Author: Janne Grunau <janne at grunau.be>
> > > Date:   Fri Sep 24 14:01:37 2010 +0200
> > > 
> > >     set video codec context options earlier to allow use of experimental video encoders
> > 
> > ok but this patch has some potential to conflict with future per codec
> > options and defaults
> 
> an alternative would be using avcodec_opts[AVMEDIA_TYPE_*]->strict_std_compliance
> directly. I've moved the set_context_opts call since it is that way for
> subtitle and audio codecs.

like attached

Janne
-------------- next part --------------
commit 6966ffc1df686e4b6d7d6d81d6a5f65d3cdd7e21
Author: Janne Grunau <janne at grunau.be>
Date:   Sat Sep 25 12:26:14 2010 +0200

    use strict_std_complience from avcodec_opts[AVMEDIA_TYPE_*]
    
    Options are not yet set for video encoders and for codec specific
    defaults it is desireable to set the codec options only after the codec
    is known.

diff --git a/ffmpeg.c b/ffmpeg.c
index 7fdf57b..ecdf277 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3401,7 +3401,7 @@ static void new_video_stream(AVFormatContext *oc)
 
         if (video_codec_name) {
             codec_id = find_codec_or_die(video_codec_name, AVMEDIA_TYPE_VIDEO, 1,
-                                         video_enc->strict_std_compliance);
+                                         avcodec_opts[AVMEDIA_TYPE_VIDEO]->strict_std_compliance);
             codec = avcodec_find_encoder_by_name(video_codec_name);
             output_codecs[nb_ocodecs] = codec;
         } else {
@@ -3533,7 +3533,7 @@ static void new_audio_stream(AVFormatContext *oc)
 
         if (audio_codec_name) {
             codec_id = find_codec_or_die(audio_codec_name, AVMEDIA_TYPE_AUDIO, 1,
-                                         audio_enc->strict_std_compliance);
+                                         avcodec_opts[AVMEDIA_TYPE_AUDIO]->strict_std_compliance);
             codec = avcodec_find_encoder_by_name(audio_codec_name);
             output_codecs[nb_ocodecs] = codec;
         } else {
@@ -3594,7 +3594,7 @@ static void new_subtitle_stream(AVFormatContext *oc)
     } else {
         set_context_opts(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], subtitle_enc, AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_ENCODING_PARAM);
         subtitle_enc->codec_id = find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 1,
-                                                   subtitle_enc->strict_std_compliance);
+                                                   avcodec_opts[AVMEDIA_TYPE_SUBTITLE]->strict_std_compliance);
         output_codecs[nb_ocodecs] = avcodec_find_encoder_by_name(subtitle_codec_name);
     }
     nb_ocodecs++;



More information about the ffmpeg-devel mailing list