Browse code

avconv: Apply codec options to streams that are copied as well

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>

Martin Storsjö authored on 2013/02/28 06:22:39
Showing 2 changed files
... ...
@@ -1766,6 +1766,8 @@ static int transcode_init(void)
1766 1766
 
1767 1767
             if (ost->st->codec->me_threshold)
1768 1768
                 input_streams[ost->source_index]->st->codec->debug |= FF_DEBUG_MV;
1769
+        } else {
1770
+            av_opt_set_dict(ost->st->codec, &ost->opts);
1769 1771
         }
1770 1772
     }
1771 1773
 
... ...
@@ -800,6 +800,8 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
800 800
                    preset, ost->file_index, ost->index);
801 801
             exit(1);
802 802
         }
803
+    } else {
804
+        ost->opts = filter_codec_opts(o->g->codec_opts, AV_CODEC_ID_NONE, oc, st, NULL);
803 805
     }
804 806
 
805 807
     avcodec_get_context_defaults3(st->codec, ost->enc);