summaryrefslogtreecommitdiff
path: root/ffprobe.c
diff options
context:
space:
mode:
authorTobias Rapp <t.rapp@noa-audio.com>2014-09-15 17:16:03 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-10-07 23:18:15 +0200
commit1acc9189b4c2c6b3ab39724e0ff80ec95c6683b3 (patch)
treee9ca9e4c1ec38bdddb14372d569189359e817953 /ffprobe.c
parent7d327d62426206bd89fc2e0b996faa5be867c0a2 (diff)
downloadffmpeg-1acc9189b4c2c6b3ab39724e0ff80ec95c6683b3.tar.gz
ffprobe: add pixel format chroma sub-sampling output
Adds output of chroma sub-sampling information to ffprobe -show_pixel_formats option. Note: This patch just prints the "raw" log2_charoma_w/h values instead of the previously suggested mapping into a chroma sub-sampling pattern string like "4:2:2". Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'ffprobe.c')
-rw-r--r--ffprobe.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/ffprobe.c b/ffprobe.c
index b6df74b1b5..f35b780ffa 100644
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -2586,6 +2586,13 @@ static void ffprobe_show_pixel_formats(WriterContext *w)
writer_print_section_header(w, SECTION_ID_PIXEL_FORMAT);
print_str("name", pixdesc->name);
print_int("nb_components", pixdesc->nb_components);
+ if ((pixdesc->nb_components >= 3) && !(pixdesc->flags & AV_PIX_FMT_FLAG_RGB)) {
+ print_int ("log2_chroma_w", pixdesc->log2_chroma_w);
+ print_int ("log2_chroma_h", pixdesc->log2_chroma_h);
+ } else {
+ print_str_opt("log2_chroma_w", "N/A");
+ print_str_opt("log2_chroma_h", "N/A");
+ }
n = av_get_bits_per_pixel(pixdesc);
if (n) print_int ("bits_per_pixel", n);
else print_str_opt("bits_per_pixel", "N/A");