[FFmpeg-devel] [PATCH 3/4] ffprobe: print mb_types frame side data

Ramiro Polla ramiro.polla at gmail.com
Sun Jun 17 07:21:16 EEST 2018


---
 fftools/ffprobe.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index 544786ec72..5bd14ebfdb 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -30,6 +30,7 @@
 
 #include "libavformat/avformat.h"
 #include "libavcodec/avcodec.h"
+#include "libavcodec/mpegutils.h"
 #include "libavutil/avassert.h"
 #include "libavutil/avstring.h"
 #include "libavutil/bprint.h"
@@ -2222,6 +2223,24 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
                 AVContentLightMetadata *metadata = (AVContentLightMetadata *)sd->data;
                 print_int("max_content", metadata->MaxCLL);
                 print_int("max_average", metadata->MaxFALL);
+            } else if (sd->type == AV_FRAME_DATA_MB_TYPES) {
+                uint32_t *mb_types = (uint32_t *)sd->data;
+                int mb_height = *mb_types++;
+                int mb_width = *mb_types++;
+                int size = mb_height * mb_width * 3 + 1;
+                char *str = av_malloc(size);
+                int mb_y, mb_x;
+                print_int("mb_height", mb_height);
+                print_int("mb_width", mb_width);
+                if (str) {
+                    char *ptr = str;
+                    const char *end = str + size;
+                    for (mb_y = 0; mb_y < mb_height; mb_y++)
+                        for (mb_x = 0; mb_x < mb_width; mb_x++)
+                            ptr += ff_mb_type_str(ptr, end - str, *mb_types++);
+                    print_str("mb_types", str);
+                    av_free(str);
+                }
             } else if (sd->type == AV_FRAME_DATA_ICC_PROFILE) {
                 AVDictionaryEntry *tag = av_dict_get(sd->metadata, "name", NULL, AV_DICT_MATCH_CASE);
                 if (tag)
-- 
2.11.0



More information about the ffmpeg-devel mailing list