drawgraph with signalstatsΒΆ

Watch on youtube.com
doc

https://ffmpeg.org/ffmpeg-filters.html#drawgraph_002c-adrawgraph, https://ffmpeg.org/ffmpeg-filters.html#signalstats-1

#! /bin/sh
ifn="Pexels_flowers_drifting_cars.mp4"
ifnb="`basename \"${ifn}\" .mp4`"
pref="`basename $0 .sh`"
#
# `drawgraph' is a low-level utility, mainly for debugging purposes.
#
ffmpeg -y -i "${ifn}" -filter_complex "
[0:v]signalstats,split[s1][s2];

[s1]drawgraph=
m1=lavfi.signalstats.YAVG:
mode=line:slide=scroll:min=0:max=255:
m2=lavfi.signalstats.UAVG:
mode=line:slide=scroll:min=0:max=255:
m3=lavfi.signalstats.VAVG:
mode=line:slide=scroll:min=0:max=255:
size=800x360:bg=0xEFEFEF@0.6,setsar=1[vg1];

[s2]drawgraph=
m1=lavfi.signalstats.SATAVG:
mode=line:slide=scroll:min=0:max=181.02:
m2=lavfi.signalstats.HUEAVG:
mode=line:slide=scroll:min=0:max=360:
size=800x360:bg=0xEFEFEF@0.6,setsar=1[vg2];

[0:v][vg1]overlay='x=(W-w)-50:y=50'[v1];
[v1][vg2]overlay='x=(W-w)-50:y=(H-h)-50'[v]
" -map '[v]' -an "${pref}_${ifnb}.mp4"