Hi all,

I’d like to use ffprobe to output information about the streams of a source 
file and libavfilter metadata at the same time. Is this possible?

If I use a filterchain as the input I can get frame metadata from libavfilter 
such as:

ffprobe -f lavfi -i "movie=example.mkv,signalstats" -show_frames -show_streams 
-of xml
ffprobe version N-42845-g7ab37ca Copyright (c) 2007-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared 
--enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables 
--enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl 
--enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid 
--enable-libfreetype --enable-libfaac --enable-libass --enable-ffplay 
--enable-libopenjpeg --disable-decoder=jpeg2000 
--extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 
--enable-nonfree --enable-vda
  libavutil      55. 13.100 / 55. 13.100
  libavcodec     57. 22.100 / 57. 22.100
  libavformat    57. 21.101 / 57. 21.101
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 23.100 /  6. 23.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
<?xml version="1.0" encoding="UTF-8"?>
<ffprobe>
Input #0, lavfi, from 'movie=example.mkv,signalstats':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: rawvideo (444P / 0x50343434), yuv444p, 720x480 [SAR 1:1 
DAR 3:2], 1k tbr, 1k tbn, 1k tbc
    <frames>
        <frame media_type="video" stream_index="0" key_frame="1" pkt_pts="0" 
pkt_pts_time="0.000000" pkt_dts="0" pkt_dts_time="0.000000" 
best_effort_timestamp="0" best_effort_timestamp_time="0.000000" pkt_pos="761" 
pkt_size="1036800" width="720" height="480" pix_fmt="yuv444p" 
sample_aspect_ratio="1:1" pict_type="I" coded_picture_number="0" 
display_picture_number="0" interlaced_frame="0" top_field_first="0" 
repeat_pict="0">
            <tag key="lavfi.signalstats.YMIN" value="18"/>
            <tag key="lavfi.signalstats.YLOW" value="97"/>
            <tag key="lavfi.signalstats.YAVG" value="145.97"/>
            <tag key="lavfi.signalstats.YHIGH" value="170"/>
            <tag key="lavfi.signalstats.YMAX" value="234"/>
            <tag key="lavfi.signalstats.UMIN" value="19"/>
            <tag key="lavfi.signalstats.ULOW" value="90"/>
            <tag key="lavfi.signalstats.UAVG" value="140.07"/>
            <tag key="lavfi.signalstats.UHIGH" value="166"/>
            <tag key="lavfi.signalstats.UMAX" value="233"/>
            <tag key="lavfi.signalstats.VMIN" value="16"/>
            <tag key="lavfi.signalstats.VLOW" value="87"/>
            <tag key="lavfi.signalstats.VAVG" value="148.122"/>
            <tag key="lavfi.signalstats.VHIGH" value="174"/>
            <tag key="lavfi.signalstats.VMAX" value="239"/>
            <tag key="lavfi.signalstats.SATMIN" value="1"/>
            <tag key="lavfi.signalstats.SATLOW" value="25"/>
            <tag key="lavfi.signalstats.SATAVG" value="46.8093"/>
            <tag key="lavfi.signalstats.SATHIGH" value="60"/>
            <tag key="lavfi.signalstats.SATMAX" value="118"/>
            <tag key="lavfi.signalstats.HUEMED" value="210"/>
            <tag key="lavfi.signalstats.HUEAVG" value="197.44"/>
            <tag key="lavfi.signalstats.YDIF" value="0"/>
            <tag key="lavfi.signalstats.UDIF" value="0"/>
            <tag key="lavfi.signalstats.VDIF" value="0"/>
        </frame>
    </frames>
    <streams>
        <stream index="0" codec_name="rawvideo" codec_long_name="raw video" 
codec_type="video" codec_time_base="1/1000" codec_tag_string="444P" 
codec_tag="0x50343434" width="720" height="480" coded_width="720" 
coded_height="480" has_b_frames="0" sample_aspect_ratio="1:1" 
display_aspect_ratio="3:2" pix_fmt="yuv444p" level="-99" refs="1" 
r_frame_rate="1000/1" avg_frame_rate="0/0" time_base="1/1000" start_pts="0" 
start_time="0.000000" nb_read_frames="1">
            <disposition default="0" dub="0" original="0" comment="0" 
lyrics="0" karaoke="0" forced="0" hearing_impaired="0" visual_impaired="0" 
clean_effects="0" attached_pic="0"/>
        </stream>
    </streams>
</ffprobe>

Here I get the frame metadata output but the stream metadata reflects the 
output of the movie filter (rawvideo) rather than information about the streams 
of the source file.

If I use the source file directly as an input, then I can not apply a filter as 
ffprobe doesn’t support -vf or -filter_complex.

ffprobe -i movie=example.mkv -vf signalstats -show_frames -show_streams -of xml
ffprobe version N-42845-g7ab37ca Copyright (c) 2007-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared 
--enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables 
--enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl 
--enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid 
--enable-libfreetype --enable-libfaac --enable-libass --enable-ffplay 
--enable-libopenjpeg --disable-decoder=jpeg2000 
--extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 
--enable-nonfree --enable-vda
  libavutil      55. 13.100 / 55. 13.100
  libavcodec     57. 22.100 / 57. 22.100
  libavformat    57. 21.101 / 57. 21.101
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 23.100 /  6. 23.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Failed to set value 'signalstats' for option 'vf': Option not found

If I try to use both a filterchain as an input and the source file as another 
input, I have an error as only one input is supported in ffprobe.

ffprobe -i movie=example.mkv -f lavfi movie=example.mkv,signalstats 
-show_frames -show_streams -of xml
ffprobe version N-42845-g7ab37ca Copyright (c) 2007-2016 the FFmpeg developers
  built with Apple LLVM version 7.0.2 (clang-700.1.81)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/HEAD --enable-shared 
--enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables 
--enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-opencl 
--enable-libx264 --enable-libmp3lame --enable-libvo-aacenc --enable-libxvid 
--enable-libfreetype --enable-libfaac --enable-libass --enable-ffplay 
--enable-libopenjpeg --disable-decoder=jpeg2000 
--extra-cflags=-I/usr/local/Cellar/openjpeg/1.5.2_1/include/openjpeg-1.5 
--enable-nonfree --enable-vda
  libavutil      55. 13.100 / 55. 13.100
  libavcodec     57. 22.100 / 57. 22.100
  libavformat    57. 21.101 / 57. 21.101
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 23.100 /  6. 23.100
  libavresample   3.  0.  0 /  3.  0.  0
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Argument 'movie=example.mkv,signalstats' provided as input filename, but 
'movie=example.mkv' was already specified.

Is it feasible (now or with sponsorship) to have a single ffprobe output that 
contains metadata about both the source file’s streams and the metadata output 
of filters (such as signalstats, cropdetect) applied to the frames?

Best Regards,
Dave Rice

_______________________________________________
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

Reply via email to