bavc / qctools

QCTools (Quality Control Tools for Video Preservation) is a free and open source software tool that helps users analyze and understand their digitized video files through use of audiovisual analytics and filtering. QCTools is funded by the National Endowment for the Humanities and the Knight Foundation, and is developed by the Bay Area Video Coalition.
http://www.bavc.org/qctools
Other
314 stars 41 forks source link

sync qctools xml output with ffprobe #219

Closed dericed closed 7 years ago

dericed commented 7 years ago

The output of QCTools for a 2 frame sample (made via ffmpeg -f lavfi -i mandelbrot -f lavfi -i sine -pix_fmt yuv420p -vframes 1 -c:v ffv1 sample.mkv) looks like

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created by QCTools 0.6.0 -->
<ffprobe:ffprobe xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ffprobe='http://www.ffmpeg.org/schema/ffprobe' xsi:schemaLocation='http://www.ffmpeg.org/schema/ffprobe ffprobe.xsd'>
    <program_version version="3.2.git" copyright="Copyright (c) 2007-2016 the FFmpeg developers" build_date="Nov  3 2016" build_time="04:44:32" compiler_ident="not available" configuration="not available"/>

    <library_versions>
        <library_version name="libavutil" major="55" minor="35" micro="100" version="3613540" ident="Lavu55.35.100"/>
        <library_version name="libavcodec" major="57" minor="66" micro="100" version="3752548" ident="Lavc57.66.100"/>
        <library_version name="libavformat" major="57" minor="57" micro="100" version="3750244" ident="Lavf57.57.100"/>
        <library_version name="libavfilter" major="6" minor="66" micro="100" version="410212" ident="Lavfi6.66.100"/>
        <library_version name="libswscale" major="4" minor="3" micro="100" version="263012" ident="SwS4.3.100"/>
    </library_versions>

    <frames>
        <frame media_type="video" key_frame="1" pkt_pts_time="0.0060000" pkt_duration_time="0.0400000" width="640" height="480">
            <tag key="lavfi.signalstats.YMIN" value="18"/>
            <tag key="lavfi.signalstats.YLOW" value="93"/>
            <tag key="lavfi.signalstats.YAVG" value="145.876"/>
            <tag key="lavfi.signalstats.YHIGH" value="170"/>
            <tag key="lavfi.signalstats.YMAX" value="234"/>
            <tag key="lavfi.signalstats.UMIN" value="26"/>
            <tag key="lavfi.signalstats.ULOW" value="89"/>
            <tag key="lavfi.signalstats.UAVG" value="139.824"/>
            <tag key="lavfi.signalstats.UHIGH" value="166"/>
            <tag key="lavfi.signalstats.UMAX" value="190"/>
            <tag key="lavfi.signalstats.VMIN" value="47"/>
            <tag key="lavfi.signalstats.VLOW" value="87"/>
            <tag key="lavfi.signalstats.VAVG" value="147.583"/>
            <tag key="lavfi.signalstats.VHIGH" value="174"/>
            <tag key="lavfi.signalstats.VMAX" value="215"/>
            <tag key="lavfi.signalstats.VDIF" value="0"/>
            <tag key="lavfi.signalstats.UDIF" value="0"/>
            <tag key="lavfi.signalstats.YDIF" value="0"/>
            <tag key="lavfi.signalstats.SATMIN" value="0"/>
            <tag key="lavfi.signalstats.SATLOW" value="30"/>
            <tag key="lavfi.signalstats.SATAVG" value="47.9869"/>
            <tag key="lavfi.signalstats.SATHIGH" value="58"/>
            <tag key="lavfi.signalstats.SATMAX" value="105"/>
            <tag key="lavfi.signalstats.HUEMED" value="211"/>
            <tag key="lavfi.signalstats.HUEAVG" value="194.675"/>
            <tag key="lavfi.signalstats.TOUT" value="0.000211589"/>
            <tag key="lavfi.signalstats.VREP" value="0.164583"/>
            <tag key="lavfi.signalstats.BRNG" value="0"/>
            <tag key="lavfi.cropdetect.x1" value="0"/>
            <tag key="lavfi.cropdetect.x2" value="640"/>
            <tag key="lavfi.cropdetect.y1" value="0"/>
            <tag key="lavfi.cropdetect.y2" value="480"/>
            <tag key="lavfi.cropdetect.w" value="640"/>
            <tag key="lavfi.cropdetect.h" value="480"/>
            <tag key="lavfi.psnr.mse.v" value="92.67"/>
            <tag key="lavfi.psnr.mse.u" value="85.48"/>
            <tag key="lavfi.psnr.mse.y" value="87.45"/>
            <tag key="lavfi.psnr.psnr.v" value="28.46"/>
            <tag key="lavfi.psnr.psnr.u" value="28.81"/>
            <tag key="lavfi.psnr.psnr.y" value="28.71"/>
            <tag key="lavfi.ssim.All" value="0.95"/>
            <tag key="lavfi.ssim.V" value="0.95"/>
            <tag key="lavfi.ssim.U" value="0.95"/>
            <tag key="lavfi.ssim.Y" value="0.95"/>
            <tag key="lavfi.idet.single.bff" value="0"/>
            <tag key="lavfi.idet.single.tff" value="0"/>
            <tag key="lavfi.idet.single.progressive" value="0"/>
            <tag key="lavfi.idet.single.undetermined" value="1"/>
            <tag key="lavfi.idet.multiple.bff" value="0"/>
            <tag key="lavfi.idet.multiple.tff" value="0"/>
            <tag key="lavfi.idet.multiple.progressive" value="0"/>
            <tag key="lavfi.idet.multiple.undetermined" value="1"/>
            <tag key="lavfi.idet.repeated.bottom" value="0"/>
            <tag key="lavfi.idet.repeated.top" value="0"/>
            <tag key="lavfi.idet.repeated.neither" value="1"/>
        </frame>
        <frame media_type="video" key_frame="0" pkt_pts_time="0.0460000" pkt_duration_time="0.0000000" width="640" height="480">
            <tag key="lavfi.signalstats.YMIN" value="18"/>
            <tag key="lavfi.signalstats.YLOW" value="93"/>
            <tag key="lavfi.signalstats.YAVG" value="145.876"/>
            <tag key="lavfi.signalstats.YHIGH" value="170"/>
            <tag key="lavfi.signalstats.YMAX" value="234"/>
            <tag key="lavfi.signalstats.UMIN" value="26"/>
            <tag key="lavfi.signalstats.ULOW" value="89"/>
            <tag key="lavfi.signalstats.UAVG" value="139.824"/>
            <tag key="lavfi.signalstats.UHIGH" value="166"/>
            <tag key="lavfi.signalstats.UMAX" value="190"/>
            <tag key="lavfi.signalstats.VMIN" value="47"/>
            <tag key="lavfi.signalstats.VLOW" value="87"/>
            <tag key="lavfi.signalstats.VAVG" value="147.583"/>
            <tag key="lavfi.signalstats.VHIGH" value="174"/>
            <tag key="lavfi.signalstats.VMAX" value="215"/>
            <tag key="lavfi.signalstats.VDIF" value="0"/>
            <tag key="lavfi.signalstats.UDIF" value="0"/>
            <tag key="lavfi.signalstats.YDIF" value="0"/>
            <tag key="lavfi.signalstats.SATMIN" value="0"/>
            <tag key="lavfi.signalstats.SATLOW" value="30"/>
            <tag key="lavfi.signalstats.SATAVG" value="47.9869"/>
            <tag key="lavfi.signalstats.SATHIGH" value="58"/>
            <tag key="lavfi.signalstats.SATMAX" value="105"/>
            <tag key="lavfi.signalstats.HUEMED" value="211"/>
            <tag key="lavfi.signalstats.HUEAVG" value="194.675"/>
            <tag key="lavfi.signalstats.TOUT" value="0.000211589"/>
            <tag key="lavfi.signalstats.VREP" value="0.164583"/>
            <tag key="lavfi.signalstats.BRNG" value="0"/>
            <tag key="lavfi.cropdetect.x1" value="0"/>
            <tag key="lavfi.cropdetect.x2" value="640"/>
            <tag key="lavfi.cropdetect.y1" value="0"/>
            <tag key="lavfi.cropdetect.y2" value="480"/>
            <tag key="lavfi.cropdetect.w" value="640"/>
            <tag key="lavfi.cropdetect.h" value="480"/>
            <tag key="lavfi.psnr.mse.v" value="92.67"/>
            <tag key="lavfi.psnr.mse.u" value="85.48"/>
            <tag key="lavfi.psnr.mse.y" value="87.45"/>
            <tag key="lavfi.psnr.psnr.v" value="28.46"/>
            <tag key="lavfi.psnr.psnr.u" value="28.81"/>
            <tag key="lavfi.psnr.psnr.y" value="28.71"/>
            <tag key="lavfi.ssim.All" value="0.95"/>
            <tag key="lavfi.ssim.V" value="0.95"/>
            <tag key="lavfi.ssim.U" value="0.95"/>
            <tag key="lavfi.ssim.Y" value="0.95"/>
            <tag key="lavfi.idet.single.bff" value="0"/>
            <tag key="lavfi.idet.single.tff" value="0"/>
            <tag key="lavfi.idet.single.progressive" value="0"/>
            <tag key="lavfi.idet.single.undetermined" value="1"/>
            <tag key="lavfi.idet.multiple.bff" value="0"/>
            <tag key="lavfi.idet.multiple.tff" value="0"/>
            <tag key="lavfi.idet.multiple.progressive" value="0"/>
            <tag key="lavfi.idet.multiple.undetermined" value="1"/>
            <tag key="lavfi.idet.repeated.bottom" value="0"/>
            <tag key="lavfi.idet.repeated.top" value="0"/>
            <tag key="lavfi.idet.repeated.neither" value="1"/>
        </frame>
        <frame media_type="audio" key_frame="1" pkt_pts_time="0.0000000" pkt_duration_time="0.0340000">
            <tag key="lavfi.r128.M" value="0"/>
            <tag key="lavfi.astats.Overall.DC_offset" value="0.001168"/>
            <tag key="lavfi.astats.Overall.Min_level" value="-0.125069"/>
            <tag key="lavfi.astats.Overall.Max_level" value="0.125047"/>
            <tag key="lavfi.astats.Overall.Min_difference" value="0"/>
            <tag key="lavfi.astats.Overall.Max_difference" value="0.008322"/>
            <tag key="lavfi.astats.Overall.Mean_difference" value="0.004158"/>
            <tag key="lavfi.astats.Overall.Peak_level" value="-18.057"/>
            <tag key="lavfi.astats.Overall.RMS_peak" value="-21.8621"/>
            <tag key="lavfi.astats.Overall.RMS_trough" value="-21.8621"/>
        </frame>
        <frame media_type="audio" key_frame="1" pkt_pts_time="0.0350000" pkt_duration_time="0.0340000">
            <tag key="lavfi.r128.M" value="0"/>
            <tag key="lavfi.astats.Overall.DC_offset" value="-0.000961"/>
            <tag key="lavfi.astats.Overall.Min_level" value="-0.124997"/>
            <tag key="lavfi.astats.Overall.Max_level" value="0.125006"/>
            <tag key="lavfi.astats.Overall.Min_difference" value="5e-06"/>
            <tag key="lavfi.astats.Overall.Max_difference" value="0.007866"/>
            <tag key="lavfi.astats.Overall.Mean_difference" value="0.005007"/>
            <tag key="lavfi.astats.Overall.Peak_level" value="-18.0614"/>
            <tag key="lavfi.astats.Overall.RMS_peak" value="-21.099"/>
            <tag key="lavfi.astats.Overall.RMS_trough" value="-21.099"/>
        </frame>
    </frames>
</ffprobe:ffprobe>

but the output of ffprobe via ffprobe -f lavfi -i "movie=sample.mkv:s=v+a[in0][in1],[in0]signalstats=stat=tout+vrep+brng,cropdetect=reset=1,split[a][b];[a]field=top[a1];[b]field=bottom[b1],[a1][b1]psnr[out0];[in1]ebur128=metadata=1[out1]" -show_frames -show_versions -of xml=x=1:q=1 -noprivate > output.xml looks like:

<?xml version="1.0" encoding="UTF-8"?>
<ffprobe:ffprobe xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ffprobe='http://www.ffmpeg.org/schema/ffprobe' xsi:schemaLocation='http://www.ffmpeg.org/schema/ffprobe ffprobe.xsd'>
    <program_version version="N-43741-g605f308" copyright="Copyright (c) 2007-2016 the FFmpeg developers" compiler_ident="Apple LLVM version 8.0.0 (clang-800.0.42.1)" configuration="--prefix=/usr/local/Cellar/ffmpeg/HEAD-605f308 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-libfreetype --enable-libmp3lame --enable-libx264 --enable-libxvid --enable-opencl --disable-lzma --enable-vda"/>

    <library_versions>
        <library_version name="libavutil" major="55" minor="40" micro="100" version="3614820" ident="Lavu55.40.100"/>
        <library_version name="libavcodec" major="57" minor="66" micro="103" version="3752551" ident="Lavc57.66.103"/>
        <library_version name="libavformat" major="57" minor="57" micro="100" version="3750244" ident="Lavf57.57.100"/>
        <library_version name="libavdevice" major="57" minor="2" micro="100" version="3736164" ident="Lavd57.2.100"/>
        <library_version name="libavfilter" major="6" minor="67" micro="100" version="410468" ident="Lavfi6.67.100"/>
        <library_version name="libswscale" major="4" minor="3" micro="101" version="263013" ident="SwS4.3.101"/>
        <library_version name="libswresample" major="2" minor="4" micro="100" version="132196" ident="SwR2.4.100"/>
        <library_version name="libpostproc" major="54" minor="2" micro="100" version="3539556" ident="postproc54.2.100"/>
    </library_versions>

    <frames>
        <frame media_type="audio" stream_index="1" 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_duration="3344" pkt_duration_time="0.069667" pkt_pos="935" pkt_size="26752" sample_fmt="dbl" nb_samples="3344" channels="1" channel_layout="mono"/>
        <frame media_type="video" stream_index="0" key_frame="1" pkt_pts="6" pkt_pts_time="0.006000" pkt_dts="6" pkt_dts_time="0.006000" best_effort_timestamp="6" best_effort_timestamp_time="0.006000" pkt_pos="1359" pkt_size="230400" width="640" height="240" pix_fmt="yuv420p" 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="93"/>
            <tag key="lavfi.signalstats.YAVG" value="145.876"/>
            <tag key="lavfi.signalstats.YHIGH" value="170"/>
            <tag key="lavfi.signalstats.YMAX" value="234"/>
            <tag key="lavfi.signalstats.UMIN" value="26"/>
            <tag key="lavfi.signalstats.ULOW" value="89"/>
            <tag key="lavfi.signalstats.UAVG" value="139.824"/>
            <tag key="lavfi.signalstats.UHIGH" value="166"/>
            <tag key="lavfi.signalstats.UMAX" value="190"/>
            <tag key="lavfi.signalstats.VMIN" value="47"/>
            <tag key="lavfi.signalstats.VLOW" value="87"/>
            <tag key="lavfi.signalstats.VAVG" value="147.583"/>
            <tag key="lavfi.signalstats.VHIGH" value="174"/>
            <tag key="lavfi.signalstats.VMAX" value="215"/>
            <tag key="lavfi.signalstats.SATMIN" value="0"/>
            <tag key="lavfi.signalstats.SATLOW" value="30"/>
            <tag key="lavfi.signalstats.SATAVG" value="47.9869"/>
            <tag key="lavfi.signalstats.SATHIGH" value="58"/>
            <tag key="lavfi.signalstats.SATMAX" value="105"/>
            <tag key="lavfi.signalstats.HUEMED" value="211"/>
            <tag key="lavfi.signalstats.HUEAVG" value="194.675"/>
            <tag key="lavfi.signalstats.YDIF" value="0"/>
            <tag key="lavfi.signalstats.UDIF" value="0"/>
            <tag key="lavfi.signalstats.VDIF" value="0"/>
            <tag key="lavfi.signalstats.YBITDEPTH" value="8"/>
            <tag key="lavfi.signalstats.UBITDEPTH" value="8"/>
            <tag key="lavfi.signalstats.VBITDEPTH" value="8"/>
            <tag key="lavfi.signalstats.TOUT" value="0.000211589"/>
            <tag key="lavfi.signalstats.VREP" value="0.164583"/>
            <tag key="lavfi.signalstats.BRNG" value="0"/>
            <tag key="lavfi.psnr.mse.y" value="87.45"/>
            <tag key="lavfi.psnr.psnr.y" value="28.71"/>
            <tag key="lavfi.psnr.mse.u" value="85.48"/>
            <tag key="lavfi.psnr.psnr.u" value="28.81"/>
            <tag key="lavfi.psnr.mse.v" value="92.67"/>
            <tag key="lavfi.psnr.psnr.v" value="28.46"/>
            <tag key="lavfi.psnr.mse_avg" value="87.99"/>
            <tag key="lavfi.psnr.psnr_avg" value="28.69"/>
        </frame>
        <frame media_type="video" stream_index="0" key_frame="1" pkt_pts="46" pkt_pts_time="0.046000" pkt_dts="46" pkt_dts_time="0.046000" best_effort_timestamp="46" best_effort_timestamp_time="0.046000" pkt_pos="95119" pkt_size="230400" width="640" height="240" pix_fmt="yuv420p" 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="93"/>
            <tag key="lavfi.signalstats.YAVG" value="145.824"/>
            <tag key="lavfi.signalstats.YHIGH" value="170"/>
            <tag key="lavfi.signalstats.YMAX" value="234"/>
            <tag key="lavfi.signalstats.UMIN" value="26"/>
            <tag key="lavfi.signalstats.ULOW" value="88"/>
            <tag key="lavfi.signalstats.UAVG" value="139.713"/>
            <tag key="lavfi.signalstats.UHIGH" value="166"/>
            <tag key="lavfi.signalstats.UMAX" value="190"/>
            <tag key="lavfi.signalstats.VMIN" value="47"/>
            <tag key="lavfi.signalstats.VLOW" value="86"/>
            <tag key="lavfi.signalstats.VAVG" value="147.467"/>
            <tag key="lavfi.signalstats.VHIGH" value="174"/>
            <tag key="lavfi.signalstats.VMAX" value="215"/>
            <tag key="lavfi.signalstats.SATMIN" value="1"/>
            <tag key="lavfi.signalstats.SATLOW" value="30"/>
            <tag key="lavfi.signalstats.SATAVG" value="48.1733"/>
            <tag key="lavfi.signalstats.SATHIGH" value="58"/>
            <tag key="lavfi.signalstats.SATMAX" value="105"/>
            <tag key="lavfi.signalstats.HUEMED" value="212"/>
            <tag key="lavfi.signalstats.HUEAVG" value="194.526"/>
            <tag key="lavfi.signalstats.YDIF" value="1.79923"/>
            <tag key="lavfi.signalstats.UDIF" value="1.41332"/>
            <tag key="lavfi.signalstats.VDIF" value="1.71007"/>
            <tag key="lavfi.signalstats.YBITDEPTH" value="8"/>
            <tag key="lavfi.signalstats.UBITDEPTH" value="8"/>
            <tag key="lavfi.signalstats.VBITDEPTH" value="8"/>
            <tag key="lavfi.signalstats.TOUT" value="0.000211589"/>
            <tag key="lavfi.signalstats.VREP" value="0.160417"/>
            <tag key="lavfi.signalstats.BRNG" value="0"/>
            <tag key="lavfi.psnr.mse.y" value="87.25"/>
            <tag key="lavfi.psnr.psnr.y" value="28.72"/>
            <tag key="lavfi.psnr.mse.u" value="86.57"/>
            <tag key="lavfi.psnr.psnr.u" value="28.76"/>
            <tag key="lavfi.psnr.mse.v" value="93.70"/>
            <tag key="lavfi.psnr.psnr.v" value="28.41"/>
            <tag key="lavfi.psnr.mse_avg" value="88.21"/>
            <tag key="lavfi.psnr.psnr_avg" value="28.68"/>
        </frame>
    </frames>
</ffprobe:ffprobe>

The qctools frame node looks like <frame media_type="video" key_frame="1" pkt_pts_time="0.0060000" pkt_duration_time="0.0400000" width="640" height="480"> and ffprobe frame node looks like <frame media_type="video" stream_index="0" key_frame="1" pkt_pts="6" pkt_pts_time="0.006000" pkt_dts="6" pkt_dts_time="0.006000" best_effort_timestamp="6" best_effort_timestamp_time="0.006000" pkt_pos="1359" pkt_size="230400" width="640" height="240" pix_fmt="yuv420p" 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">

I propose supplementing the qctools output to look more like the ffprobe output. Some of the additional values of ffprobe, such as pkt_size may be worth plotting as well.

dericed commented 7 years ago

priorities to add

frame/@stream_index (used to relate/group frames to stream [significant when there's multiple streams of one stream_type])
frame/@pkt_pos
frame/@pkt_size
frame/@pix_fmt
frame/@pict_type
dericed commented 7 years ago

closing though i may add another ticket to add stream and format data to the qctools report.