diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-04-19 01:02:17 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-04-19 01:02:21 +0200 |
commit | 7254afdf1c60f2786ff1f2a89e090f6c016ab85d (patch) | |
tree | 7254e50defef2854a5793b5b16c10e56fbf308f6 /ffmpeg_opt.c | |
parent | 020c287f5ee51f06fd662f4ab79cb22acc5da204 (diff) | |
parent | b1cc12d0e3aa9f800de1cd6ffa6a2c54e78b4e5d (diff) | |
download | ffmpeg-7254afdf1c60f2786ff1f2a89e090f6c016ab85d.tar.gz |
Merge remote-tracking branch 'cigaes/master'
* cigaes/master:
ffmpeg: make -aspect work with -vcodec copy.
lavfi/vf_aspect: improve compatibility of parsing.
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffmpeg_opt.c')
-rw-r--r-- | ffmpeg_opt.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c index d06dac7cd8..f03f29bb50 100644 --- a/ffmpeg_opt.c +++ b/ffmpeg_opt.c @@ -1168,7 +1168,7 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in AVStream *st; OutputStream *ost; AVCodecContext *video_enc; - char *frame_rate = NULL; + char *frame_rate = NULL, *frame_aspect_ratio = NULL; ost = new_output_stream(o, oc, AVMEDIA_TYPE_VIDEO, source_index); st = ost->st; @@ -1180,10 +1180,21 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in exit(1); } + MATCH_PER_STREAM_OPT(frame_aspect_ratios, str, frame_aspect_ratio, oc, st); + if (frame_aspect_ratio) { + AVRational q; + if (av_parse_ratio(&q, frame_aspect_ratio, 255, 0, NULL) < 0 || + q.num <= 0 || q.den <= 0) { + av_log(NULL, AV_LOG_FATAL, "Invalid aspect ratio: %s\n", frame_aspect_ratio); + exit(1); + } + ost->frame_aspect_ratio = q; + } + if (!ost->stream_copy) { const char *p = NULL; char *frame_size = NULL; - char *frame_aspect_ratio = NULL, *frame_pix_fmt = NULL; + char *frame_pix_fmt = NULL; char *intra_matrix = NULL, *inter_matrix = NULL; int do_pass = 0; int i; @@ -1194,17 +1205,6 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc, in exit(1); } - MATCH_PER_STREAM_OPT(frame_aspect_ratios, str, frame_aspect_ratio, oc, st); - if (frame_aspect_ratio) { - AVRational q; - if (av_parse_ratio(&q, frame_aspect_ratio, 255, 0, NULL) < 0 || - q.num <= 0 || q.den <= 0) { - av_log(NULL, AV_LOG_FATAL, "Invalid aspect ratio: %s\n", frame_aspect_ratio); - exit(1); - } - ost->frame_aspect_ratio = q; - } - video_enc->bits_per_raw_sample = frame_bits_per_raw_sample; MATCH_PER_STREAM_OPT(frame_pix_fmts, str, frame_pix_fmt, oc, st); if (frame_pix_fmt && *frame_pix_fmt == '+') { |