Export FFmpeg Frame Entropy to CSV

This article provides a straightforward guide on how to extract frame-level entropy metadata from a video file and export it directly into a CSV file using FFmpeg’s companion tool, FFprobe. You will learn the exact command-line instructions and parameter breakdowns required to measure video frame complexity and save the results for data analysis.

To extract frame-level entropy, you must use FFprobe combined with FFmpeg’s entropy multimedia filter. The entropy filter measures the information density (entropy) of each color channel per frame.

Run the following command in your terminal to analyze a video and save the timestamp and normalized luminance (Y) entropy to a CSV file:

ffprobe -v error -f lavfi -i "movie=input.mp4,entropy" -show_entries frame=pkt_pts_time:frame_tags=lavfi.entropy.normalized_entropy.y -of csv=p=0 > entropy.csv

Command Breakdown

Exporting Multiple Entropy Metrics

If you want to extract raw (non-normalized) entropy or include other color channels (such as U and V chroma channels), you can expand the frame_tags key.

Use this command to export the timestamp alongside raw luminance entropy, normalized luminance entropy, and chroma entropy:

ffprobe -v error -f lavfi -i "movie=input.mp4,entropy" -show_entries frame=pkt_pts_time:frame_tags=lavfi.entropy.entropy.y,lavfi.entropy.normalized_entropy.y,lavfi.entropy.normalized_entropy.u,lavfi.entropy.normalized_entropy.v -of csv=p=0 > detailed_entropy.csv

The resulting CSV file will contain one row per video frame, with columns ordered exactly as specified in your frame_tags argument.