summaryrefslogtreecommitdiff
path: root/libavformat/framehash.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-04-12 11:17:47 -0300
committerJames Almer <jamrial@gmail.com>2016-04-12 11:18:57 -0300
commite3111b1ff8592b7bafe5accd9708e7f3cab60adb (patch)
tree8328189a9f9f6adcd1d272d27dbde77b081e0843 /libavformat/framehash.c
parentf4a0236cbd75249418b40e8aa88b0264c0b58b69 (diff)
downloadffmpeg-e3111b1ff8592b7bafe5accd9708e7f3cab60adb.tar.gz
avformat/framehash: Add more information to the output
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavformat/framehash.c')
-rw-r--r--libavformat/framehash.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/libavformat/framehash.c b/libavformat/framehash.c
index a8357b04ae..7431d45c22 100644
--- a/libavformat/framehash.c
+++ b/libavformat/framehash.c
@@ -20,7 +20,7 @@
#include "internal.h"
-int ff_framehash_write_header(AVFormatContext *s)
+int ff_framehash_write_header(AVFormatContext *s, int version)
{
int i;
@@ -28,7 +28,22 @@ int ff_framehash_write_header(AVFormatContext *s)
avio_printf(s->pb, "#software: %s\n", LIBAVFORMAT_IDENT);
for (i = 0; i < s->nb_streams; i++) {
AVStream *st = s->streams[i];
+ AVCodecParameters *avctx = st->codecpar;
avio_printf(s->pb, "#tb %d: %d/%d\n", i, st->time_base.num, st->time_base.den);
+ if (version > 1) {
+ avio_printf(s->pb, "#media_type %d: %s\n", i, av_get_media_type_string(avctx->codec_type));
+ avio_printf(s->pb, "#codec_id %d: %s\n", i, avcodec_get_name(avctx->codec_id));
+ switch (avctx->codec_type) {
+ case AVMEDIA_TYPE_AUDIO:
+ avio_printf(s->pb, "#sample_rate %d: %d\n", i,avctx->sample_rate);
+ avio_printf(s->pb, "#channel_layout %d: %"PRIx64"\n", i,avctx->channel_layout);
+ break;
+ case AVMEDIA_TYPE_VIDEO:
+ avio_printf(s->pb, "#dimensions %d: %dx%d\n", i, avctx->width, avctx->height);
+ avio_printf(s->pb, "#sar %d: %d/%d\n", i, st->sample_aspect_ratio.num, st->sample_aspect_ratio.den);
+ break;
+ }
+ }
avio_flush(s->pb);
}
return 0;