summaryrefslogtreecommitdiff
path: root/ffmpeg_opt.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_opt.c
parent0b5adc35200888ca87e68823ac73905b7eb4279e (diff)
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_opt.c')
-rw-r--r--ffmpeg_opt.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 03e049bd8d..1f281f605a 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -1138,8 +1138,11 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
MATCH_PER_STREAM_OPT(bitstream_filters, str, bsf, oc, st);
while (bsf) {
+ char *arg = NULL;
if (next = strchr(bsf, ','))
*next++ = 0;
+ if (arg = strchr(bsf, '='))
+ *arg++ = 0;
if (!(bsfc = av_bitstream_filter_init(bsf))) {
av_log(NULL, AV_LOG_FATAL, "Unknown bitstream filter %s\n", bsf);
exit_program(1);
@@ -1148,6 +1151,7 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
bsfc_prev->next = bsfc;
else
ost->bitstream_filters = bsfc;
+ av_dict_set(&ost->bsf_args, bsfc->filter->name, arg, 0);
bsfc_prev = bsfc;
bsf = next;