aboutsummaryrefslogtreecommitdiffstats
path: root/ffmpeg.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-19 01:02:17 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-19 01:02:21 +0200
commit7254afdf1c60f2786ff1f2a89e090f6c016ab85d (patch)
tree7254e50defef2854a5793b5b16c10e56fbf308f6 /ffmpeg.c
parent020c287f5ee51f06fd662f4ab79cb22acc5da204 (diff)
parentb1cc12d0e3aa9f800de1cd6ffa6a2c54e78b4e5d (diff)
downloadffmpeg-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.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 :