Audio/Video Quality Testing: Using ffmpeg Filters and VQI for Black Screen, Freeze, Blur, and Silence Detection
This article explains how to assess audio and video quality by leveraging ffmpeg filter graphs and the VQI tool to detect issues such as black screens, black frames, blur, freezing, black borders, silence, and volume anomalies, providing command‑line examples and parameter details.
Tool Introduction
ffmpeg provides a rich set of filters (ffmpeg‑filters) that can modify or analyse raw audio/video frames, such as scaling, cropping, flipping, and overlaying. Filters can be chained into a filtergraph to perform complex processing.
VQI (Video Quality Indicators) is an open‑source suite that can evaluate various video quality metrics (black screen, block loss, blur, freezing, letter‑boxing, etc.) on macOS, Windows, and Linux, with scripts available for bash, batch, Python, and MATLAB.
Black Screen Detection
ffmpeg blackdetect filter
Detects periods where the frame is considered black based on configurable thresholds.
Key options:
black_min_duration (d): minimum duration of a black segment (default 2.0 s).
picture_black_ratio_th (pic_th): proportion of black pixels in a frame (default 0.98).
pixel_black_th (pix_th): pixel‑level black threshold (default 0.10).
Example command:
ffmpeg -i INPUT -vf blackdetect=d=2:pix_th=0.00:pic_th=0.9 OUTPUTffmpeg blackframe filter
Provides detailed information per black frame, including frame number, black pixel ratio, PTS, and time.
Key options:
threshold (thresh): pixel black threshold (default 32).
amount: percentage of black pixels required to flag a frame (default 98).
VQI black frame detection
Outputs a simple CSV where each frame is marked 1 for black frame and 0 otherwise.
Example usage:
sh mitsuScript.sh <mp4_dir> <path_of_vqibinary>Block‑Loss (Blur) Detection
Block‑loss appears as irregular colored pixel blocks caused by stream corruption. VQI’s blockloss indicator reports a value from 0 to 5 (higher means more severe).
VQI’s Blur indicator similarly ranges 0‑5, with larger values indicating greater blur.
Freezing (Stutter) Detection
Frames that linger longer than a threshold cause visible stutter. VQI’s Freezing indicator marks such frames with a value of 1, otherwise 0.
Black Border Detection
Black borders (letter‑boxing or pillar‑boxing) may result from mismatched source and output resolutions. VQI provides Letter‑boxing and pillar‑boxing metrics where 0 means no border and larger values indicate larger black areas.
Silence Detection
ffmpeg’s silencedetect audio filter logs silent intervals based on configurable noise tolerance and minimum duration.
Key options:
noise (n): noise tolerance (default –60 dB).
duration (d): minimum silence length to report (default 2 s).
Example command:
ffmpeg -i INPUT -af silencedetect=d=5:n=-50dB OUTPUTVolume Check
ffmpeg’s volumedetect filter reports RMS and maximum volume levels in dB.
Example command:
ffmpeg -i INPUT -filter_complex volumedetect -c:v copy -f null /dev/nullThese tools together enable comprehensive audio/video quality testing beyond basic playback verification.
Byte Quality Assurance Team
World-leading audio and video quality assurance team, safeguarding the AV experience of hundreds of millions of users.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.