summaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorChristophe Gisquet <christophe.gisquet@gmail.com>2014-11-29 19:15:02 +0100
committerMichael Niedermayer <michaelni@gmx.at>2014-11-30 13:11:34 +0100
commit4c592c39087a15e2b37aa46956775b7fa869fa57 (patch)
treeffb2270e5270d05dfc1dbeb7d9accd502af81d0d /ffmpeg.c
parent0b5adc35200888ca87e68823ac73905b7eb4279e (diff)
downloadffmpeg-streaming-4c592c39087a15e2b37aa46956775b7fa869fa57.zip
ffmpeg-streaming-4c592c39087a15e2b37aa46956775b7fa869fa57.tar.gz
ffmpeg: take bsf arguments from the command line
The format is now: -bsf:X filter1[=opt1=str1/opt2=str2],filter2 ie the parameters are appended after the filter name using '='. As ',' has been reserved already for the list of filters, '/' is just an example of token separation for now, but that could become part of the API to avoid each bsf using its own tokenization. The proper solution would be using AVOption, but this is overkill for now. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index 57abd30..b44401f 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -623,7 +623,11 @@ static void write_frame(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
while (bsfc) {
AVPacket new_pkt = *pkt;
- int a = av_bitstream_filter_filter(bsfc, avctx, NULL,
+ AVDictionaryEntry *bsf_arg = av_dict_get(ost->bsf_args,
+ bsfc->filter->name,
+ NULL, 0);
+ int a = av_bitstream_filter_filter(bsfc, avctx,
+ bsf_arg ? bsf_arg->value : NULL,
&new_pkt.data, &new_pkt.size,
pkt->data, pkt->size,
pkt->flags & AV_PKT_FLAG_KEY);
@@ -3834,6 +3838,7 @@ static int transcode(void)
av_dict_free(&ost->encoder_opts);
av_dict_free(&ost->swr_opts);
av_dict_free(&ost->resample_opts);
+ av_dict_free(&ost->bsf_args);
}
}
}
OpenPOWER on IntegriCloud