[SCM] libav/experimental: print more time_base fps stuff if av_log level is at debug or above print more likely correct fps not sure if this is formated optimally ...
siretart at users.alioth.debian.org
siretart at users.alioth.debian.org
Sun Jun 30 15:45:08 UTC 2013
The following commit has been merged in the experimental branch:
commit 21189011922a9d2dbff4ebba9d5bacc9d1215f99
Author: Michael Niedermayer <michaelni at gmx.at>
Date: Sun Sep 18 14:45:17 2005 +0000
print more time_base fps stuff if av_log level is at debug or above
print more likely correct fps
not sure if this is formated optimally ...
Originally committed as revision 4596 to svn://svn.ffmpeg.org/ffmpeg/trunk
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 26c5645..1cec213 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1072,9 +1072,14 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
}
if (enc->width) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),
- ", %dx%d, %0.2f fps",
- enc->width, enc->height,
- 1/av_q2d(enc->time_base));
+ ", %dx%d",
+ enc->width, enc->height);
+ if(av_log_get_level() >= AV_LOG_DEBUG){
+ int g= ff_gcd(enc->time_base.num, enc->time_base.den);
+ snprintf(buf + strlen(buf), buf_size - strlen(buf),
+ ", %d/%d",
+ enc->time_base.num/g, enc->time_base.den/g);
+ }
}
if (encode) {
snprintf(buf + strlen(buf), buf_size - strlen(buf),
diff --git a/libavformat/utils.c b/libavformat/utils.c
index edac0b8..c49547c 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2598,6 +2598,7 @@ void dump_format(AVFormatContext *ic,
}
for(i=0;i<ic->nb_streams;i++) {
AVStream *st = ic->streams[i];
+ int g= ff_gcd(st->time_base.num, st->time_base.den);
avcodec_string(buf, sizeof(buf), st->codec, is_output);
av_log(NULL, AV_LOG_INFO, " Stream #%d.%d", index, i);
/* the pid is an important information, so we display it */
@@ -2612,6 +2613,10 @@ void dump_format(AVFormatContext *ic,
if (strlen(st->language) > 0) {
av_log(NULL, AV_LOG_INFO, "(%s)", st->language);
}
+ av_log(NULL, AV_LOG_DEBUG, ", %d/%d", st->time_base.num/g, st->time_base.den/g);
+ if(st->codec->codec_type == CODEC_TYPE_VIDEO){
+ av_log(NULL, AV_LOG_INFO, ", %5.2f fps", av_q2d(st->r_frame_rate));
+ }
av_log(NULL, AV_LOG_INFO, ": %s\n", buf);
}
}
--
Libav/FFmpeg packaging
More information about the pkg-multimedia-commits
mailing list