avconv: Apply codec options to streams that are copied as well
authorMartin Storsjö <martin@martin.st>
Wed, 27 Feb 2013 21:22:39 +0000 (23:22 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 28 Feb 2013 16:30:42 +0000 (18:30 +0200)
This allows setting/overriding e.g. the bitrate parameter, which
is required for the smoothstreaming muxer. Normally, the bitrate
is set by the demuxer in these cases, but not all demuxers can
provide it. This allows stream copy of data to the smoothstreaming
muxer from such inputs.

Signed-off-by: Martin Storsjö <martin@martin.st>
avconv.c
avconv_opt.c

index 4ad01c2..75a8f0d 100644 (file)
--- a/avconv.c
+++ b/avconv.c
@@ -1766,6 +1766,8 @@ static int transcode_init(void)
 
             if (ost->st->codec->me_threshold)
                 input_streams[ost->source_index]->st->codec->debug |= FF_DEBUG_MV;
+        } else {
+            av_opt_set_dict(ost->st->codec, &ost->opts);
         }
     }
 
index 2a40087..7c58f49 100644 (file)
@@ -800,6 +800,8 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
                    preset, ost->file_index, ost->index);
             exit(1);
         }
+    } else {
+        ost->opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL);
     }
 
     avcodec_get_context_defaults3(st->codec, ost->enc);