How to Detect VFR or CFR Video Using FFprobe
Determining whether a video file uses a Variable Frame Rate (VFR) or
a Constant Frame Rate (CFR) is crucial for smooth video editing,
transcoding, and playback compatibility. This article provides a
straightforward guide on how to use ffprobe—the
command-line media analyzer bundled with FFmpeg—to inspect your video
files and quickly identify if they are VFR or CFR.
Method 1: Comparing Frame Rates (The Quick Check)
The fastest way to check for VFR is to compare the nominal frame rate against the average frame rate.
Run the following command in your terminal:
ffprobe -v error -select_streams v:0 -show_entries stream=r_frame_rate,avg_frame_rate -of default=noprint_wrappers=1 input.mp4How to interpret the output:
You will see two values, for example:
r_frame_rate=30/1
avg_frame_rate=30/1
- Constant Frame Rate (CFR): If
r_frame_rateandavg_frame_rateare exactly the same (e.g., both are30/1or24000/1001), the video is CFR. - Variable Frame Rate (VFR): If the two values are
different (e.g.,
r_frame_rate=30/1butavg_frame_rate=2997/100), the video is VFR.
Method 2: Analyzing Frame Durations (The Definitive Check)
Comparing average frame rates can occasionally be inconclusive. To get a 100% accurate result, you can inspect the actual presentation duration of every individual frame.
Run this command to output the duration of each frame:
ffprobe -v error -select_streams v:0 -show_entries frame=pkt_duration_time -of csv=p=0 input.mp4To easily count the unique frame durations (on Linux, macOS, or Git
Bash on Windows), pipe the output to sort and
uniq:
ffprobe -v error -select_streams v:0 -show_entries frame=pkt_duration_time -of csv=p=0 input.mp4 | sort | uniq -cHow to interpret the output:
CFR Video: The output will show only one duration value (or one dominant value with negligible audio-sync jitter):
1800 0.033333(This means all 1,800 frames have an identical duration of 0.033333 seconds, confirming exactly 30 fps).
VFR Video: The output will list multiple different duration values:
450 0.033333 120 0.016667 300 0.050000(This means frames are being held for different lengths of time, confirming the video is VFR).