#include "libavutil/intreadwrite.h"
#include "libavutil/log.h"
#include "libavutil/mathematics.h"
+#include "libavutil/opt.h"
#include "libavutil/avstring.h"
#include "libavutil/replaygain.h"
#include "libavutil/stereo3d.h"
{
uint64_t v = lrintf(d * 100);
if (v % 100)
- av_log(NULL, AV_LOG_INFO, ", %3.2f %s", d, postfix);
+ av_log(NULL, AV_LOG_INFO, "%3.2f %s", d, postfix);
else if (v % (100 * 1000))
- av_log(NULL, AV_LOG_INFO, ", %1.0f %s", d, postfix);
+ av_log(NULL, AV_LOG_INFO, "%1.0f %s", d, postfix);
else
- av_log(NULL, AV_LOG_INFO, ", %1.0fk %s", d / 1000, postfix);
+ av_log(NULL, AV_LOG_INFO, "%1.0fk %s", d / 1000, postfix);
}
static void dump_metadata(void *ctx, AVDictionary *m, const char *indent)
int flags = (is_output ? ic->oformat->flags : ic->iformat->flags);
AVStream *st = ic->streams[i];
AVDictionaryEntry *lang = av_dict_get(st->metadata, "language", NULL, 0);
+ char *separator = ic->dump_separator;
+ char **codec_separator = av_opt_ptr(st->codec->av_class, st->codec, "dump_separator");
+ int use_format_separator = !*codec_separator;
+ if (use_format_separator)
+ *codec_separator = av_strdup(separator);
avcodec_string(buf, sizeof(buf), st->codec, is_output);
+ if (use_format_separator)
+ av_freep(codec_separator);
av_log(NULL, AV_LOG_INFO, " Stream #%d:%d", index, i);
/* the pid is an important information, so we display it */
}
if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
- if (st->avg_frame_rate.den && st->avg_frame_rate.num)
- print_fps(av_q2d(st->avg_frame_rate), "fps");
-#if FF_API_R_FRAME_RATE
- if (st->r_frame_rate.den && st->r_frame_rate.num)
- print_fps(av_q2d(st->r_frame_rate), "tbr");
-#endif
- if (st->time_base.den && st->time_base.num)
- print_fps(1 / av_q2d(st->time_base), "tbn");
- if (st->codec->time_base.den && st->codec->time_base.num)
+ int fps = st->avg_frame_rate.den && st->avg_frame_rate.num;
+ int tbr = st->r_frame_rate.den && st->r_frame_rate.num;
+ int tbn = st->time_base.den && st->time_base.num;
+ int tbc = st->codec->time_base.den && st->codec->time_base.num;
+
+ if (fps || tbr || tbn || tbc)
+ av_log(NULL, AV_LOG_INFO, "%s", separator);
+
+ if (fps)
+ print_fps(av_q2d(st->avg_frame_rate), tbr || tbn || tbc ? "fps, " : "fps");
+ if (tbr)
+ print_fps(av_q2d(st->r_frame_rate), tbn || tbc ? "tbr, " : "tbr");
+ if (tbn)
+ print_fps(1 / av_q2d(st->time_base), tbc ? "tbn, " : "tbn");
+ if (tbc)
print_fps(1 / av_q2d(st->codec->time_base), "tbc");
}
for (i = 0; i < ic->nb_chapters; i++) {
AVChapter *ch = ic->chapters[i];
- av_log(NULL, AV_LOG_INFO, " Chapter #%d.%d: ", index, i);
+ av_log(NULL, AV_LOG_INFO, " Chapter #%d:%d: ", index, i);
av_log(NULL, AV_LOG_INFO,
"start %f, ", ch->start * av_q2d(ch->time_base));
av_log(NULL, AV_LOG_INFO,