diff options
author | Michel Bardiaux <mbardiaux@mediaxim.be> | 2007-10-18 14:01:20 +0000 |
---|---|---|
committer | Michel Bardiaux <mbardiaux@mediaxim.be> | 2007-10-18 14:01:20 +0000 |
commit | 59771f7191ca7716c3e3b8a411e870a63ed36d88 (patch) | |
tree | a591a79bf17435543c66cc811c61f6813be34874 /libavcodec | |
parent | 3c11a27b440e27c3796592aa8fb7fed966386a21 (diff) | |
download | ffmpeg-59771f7191ca7716c3e3b8a411e870a63ed36d88.tar.gz |
Print pixel and display aspect ratios
Originally committed as revision 10778 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/utils.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/libavcodec/utils.c b/libavcodec/utils.c index 3d4c2f2f5f..af414c0096 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1075,6 +1075,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) char buf1[32]; char channels_str[100]; int bitrate; + AVRational display_aspect_ratio; if (encode) p = avcodec_find_encoder(enc->codec_id); @@ -1125,6 +1126,14 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) snprintf(buf + strlen(buf), buf_size - strlen(buf), ", %dx%d", enc->width, enc->height); + av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den, + enc->width*enc->sample_aspect_ratio.num, + enc->height*enc->sample_aspect_ratio.den, + 1024*1024); + snprintf(buf + strlen(buf), buf_size - strlen(buf), + " [PAR %d:%d DAR %d:%d]", + enc->sample_aspect_ratio.num, enc->sample_aspect_ratio.den, + display_aspect_ratio.num, display_aspect_ratio.den); if(av_log_level >= AV_LOG_DEBUG){ int g= ff_gcd(enc->time_base.num, enc->time_base.den); snprintf(buf + strlen(buf), buf_size - strlen(buf), |