[FFmpeg-devel] [PATCH] ffprobe: Add a few common disposition cases

Derek Buitenhuis derek.buitenhuis at gmail.com
Tue Sep 18 18:17:29 CEST 2012


This info is crucial in knowing which stream to pick in an
automated setup.

Signed-off-by: Derek Buitenhuis <derek.buitenhuis at gmail.com>
---
 ffprobe.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/ffprobe.c b/ffprobe.c
index a0aee83..cf4ef21 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1665,6 +1665,12 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
         print_str("codec_tag_string",    val_str);
         print_fmt("codec_tag", "0x%04x", dec_ctx->codec_tag);
 
+        /* Handle some common stream dispositions */
+        if (stream->disposition & AV_DISPOSITION_DEFAULT)
+            print_int("default", 1);
+        if (stream->disposition & AV_DISPOSITION_FORCED)
+            print_int("forced", 1);
+
         switch (dec_ctx->codec_type) {
         case AVMEDIA_TYPE_VIDEO:
             print_int("width",        dec_ctx->width);
@@ -1693,6 +1699,10 @@ static void show_stream(WriterContext *w, AVFormatContext *fmt_ctx, int stream_i
             } else {
                 print_str_opt("timecode", "N/A");
             }
+
+            if (stream->disposition & AV_DISPOSITION_ATTACHED_PIC)
+                print_int("is_attached_pic", 1);
+
             break;
 
         case AVMEDIA_TYPE_AUDIO:
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list