From 538bf767373f176b6487e30181155e74b37cced6 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sun, 26 May 2013 15:31:09 +0200 Subject: avconv: make -aspect work with streamcopy --- avconv_opt.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'avconv_opt.c') diff --git a/avconv_opt.c b/avconv_opt.c index ae9b72ee9d..3245709e02 100644 --- a/avconv_opt.c +++ b/avconv_opt.c @@ -983,15 +983,20 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc) AVStream *st; OutputStream *ost; AVCodecContext *video_enc; + char *frame_aspect_ratio = NULL; ost = new_output_stream(o, oc, AVMEDIA_TYPE_VIDEO); st = ost->st; video_enc = st->codec; + MATCH_PER_STREAM_OPT(frame_aspect_ratios, str, frame_aspect_ratio, oc, st); + if (frame_aspect_ratio) + ost->frame_aspect_ratio = parse_frame_aspect_ratio(frame_aspect_ratio); + if (!ost->stream_copy) { const char *p = NULL; char *frame_rate = NULL, *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; @@ -1008,10 +1013,6 @@ static OutputStream *new_video_stream(OptionsContext *o, AVFormatContext *oc) exit(1); } - MATCH_PER_STREAM_OPT(frame_aspect_ratios, str, frame_aspect_ratio, oc, st); - if (frame_aspect_ratio) - ost->frame_aspect_ratio = parse_frame_aspect_ratio(frame_aspect_ratio); - MATCH_PER_STREAM_OPT(frame_pix_fmts, str, frame_pix_fmt, oc, st); if (frame_pix_fmt && (video_enc->pix_fmt = av_get_pix_fmt(frame_pix_fmt)) == AV_PIX_FMT_NONE) { av_log(NULL, AV_LOG_FATAL, "Unknown pixel format requested: %s.\n", frame_pix_fmt); -- cgit v1.2.3