changeset 5837:4400d47f7c91 libavcodec

Print pixel and display aspect ratios
author mbardiaux
date Thu, 18 Oct 2007 14:01:20 +0000
parents 0859108b4ae3
children fd8b56703750
files utils.c
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Thu Oct 18 11:11:33 2007 +0000
+++ b/utils.c	Thu Oct 18 14:01:20 2007 +0000
@@ -1075,6 +1075,7 @@
     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 @@
             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),