aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-04-09 11:21:47 +0200
committerNicolas George <nicolas.george@normalesup.org>2013-04-18 22:59:54 +0200
commitb1cc12d0e3aa9f800de1cd6ffa6a2c54e78b4e5d (patch)
tree9d85e2548e8277ac3115b0e439e134f1eb9b4b6f /ffmpeg.c
parentb42827ffd99fe192227dd10dfa31124e57949a96 (diff)
downloadffmpeg-b1cc12d0e3aa9f800de1cd6ffa6a2c54e78b4e5d.tar.gz
ffmpeg: make -aspect work with -vcodec copy.
Diffstat (limited to 'ffmpeg.c')
-rw-r--r--ffmpeg.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ffmpeg.c b/ffmpeg.c
index ea41645191..30b69d3aed 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2224,7 +2224,14 @@ static int transcode_init(void)
codec->width = icodec->width;
codec->height = icodec->height;
codec->has_b_frames = icodec->has_b_frames;
- if (!codec->sample_aspect_ratio.num) {
+ if (ost->frame_aspect_ratio.num) { // overridden by the -aspect cli option
+ codec->sample_aspect_ratio =
+ ost->st->sample_aspect_ratio =
+ av_mul_q(ost->frame_aspect_ratio,
+ (AVRational){ codec->height, codec->width });
+ av_log(NULL, AV_LOG_WARNING, "Overriding aspect ratio "
+ "with stream copy may produce invalid files\n");
+ } else if (!codec->sample_aspect_ratio.num) {
codec->sample_aspect_ratio =
ost->st->sample_aspect_ratio =
ist->st->sample_aspect_ratio.num ? ist->st->sample_aspect_ratio :