[FFmpeg-cvslog] ffprobe: show audio frame channels and channel_layout

Stefano Sabatini git at videolan.org
Tue Jul 31 13:32:42 CEST 2012


ffmpeg | branch: master | Stefano Sabatini <stefasab at gmail.com> | Mon Jul 30 15:53:14 2012 +0200| [c809b89a1272226916890e6bff7d406772c846e1] | committer: Stefano Sabatini

ffprobe: show audio frame channels and channel_layout

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c809b89a1272226916890e6bff7d406772c846e1
---

 doc/ffprobe.xsd |    2 ++
 ffprobe.c       |    8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/doc/ffprobe.xsd b/doc/ffprobe.xsd
index 3a4a8cc..13c0d02 100644
--- a/doc/ffprobe.xsd
+++ b/doc/ffprobe.xsd
@@ -62,6 +62,8 @@
       <!-- audio attributes -->
       <xsd:attribute name="sample_fmt"             type="xsd:string"/>
       <xsd:attribute name="nb_samples"             type="xsd:long"  />
+      <xsd:attribute name="channels"               type="xsd:int"   />
+      <xsd:attribute name="channel_layout"         type="xsd:string"/>
 
       <!-- video attributes -->
       <xsd:attribute name="width"                  type="xsd:long"  />
diff --git a/ffprobe.c b/ffprobe.c
index e14de3b..f81bc3b 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1647,6 +1647,14 @@ static void show_frame(WriterContext *w, AVFrame *frame, AVStream *stream,
         if (s) print_str    ("sample_fmt", s);
         else   print_str_opt("sample_fmt", "unknown");
         print_int("nb_samples",         frame->nb_samples);
+        print_int("channels", av_frame_get_channels(frame));
+        if (av_frame_get_channel_layout(frame)) {
+            av_bprint_clear(&pbuf);
+            av_bprint_channel_layout(&pbuf, av_frame_get_channels(frame),
+                                     av_frame_get_channel_layout(frame));
+            print_str    ("channel_layout", pbuf.str);
+        } else
+            print_str_opt("channel_layout", "unknown");
         break;
     }
     show_tags(av_frame_get_metadata(frame));



More information about the ffmpeg-cvslog mailing list