How to Compare Dimensions and Frame Rates Across a Folder of Video Clips
To compare video clips before editing, create a spreadsheet report with each file’s stored width, height, aspect ratios and frame-rate values. Sort the report to find mismatches, then preview representative clips in your intended sequence. Preserve fractional frame rates: 30000/1001 is approximately 29.970 fps, so rounding everything to 30 hides a useful distinction.
This workflow is for an editor assembling mixed clips into one visual sequence. It produces a reusable folder report and a practical review list, so you can decide which clips need scaling, reframing or closer timing inspection before building the edit.
1. Define the sequence you are comparing against
Write down the intended output before examining the folder. For the worked example here, assume a fictional tabletop animation featuring a blue paper kite and rotating wooden shapes. The intended sequence is 1920 × 1080, square pixels, progressive, at exactly 30 fps. These are illustrative project choices, not universal recommendations.
Keep two questions separate: which clips share the same source properties, and which clips suit the intended sequence? A folder can contain several consistent groups while still requiring different treatment in the edit. Adobe documents that assets with different dimensions can appear too small or over-cropped when placed in a sequence, depending on their scale. Adobe: Aspect ratio preservation
Use the delivery requirement or your deliberate creative choice as the comparison target. Avoid letting the first imported clip make that decision accidentally.
2. Record dimensions, aspect ratios and both frame-rate fields
Capture the following fields rather than relying on a filename such as kite_final_1080p.mp4:
| Report field | What to examine |
|---|---|
width, height |
Stored frame dimensions in pixels |
sample_aspect_ratio |
Pixel shape; 1:1 means square pixels |
display_aspect_ratio |
Reported display proportions |
avg_frame_rate |
Average frame rate |
r_frame_rate |
Reported base frame rate |
field_order |
Whether the stream reports progressive or an interlaced field order |
Stream index |
Which stream the row describes |
FFmpeg defines avg_frame_rate as the average rate and describes r_frame_rate as a base rate inferred from stream timing, explicitly warning that it is a guess. Preserve both values; a difference is a reason to investigate, rather than a definitive variable-frame-rate diagnosis. FFmpeg: AVStream Struct Reference
Dimensions alone also need context. Pixel aspect ratio can affect the displayed shape: Adobe’s documentation gives 1440 × 1080 footage with anamorphic pixels as an example. For unusual material, inspect the image and its interpretation in the editor before deciding it needs cropping or stretching. Adobe: Aspect ratio preservation
3. Generate a folder report with ffprobe and Python
Install Python 3 and an FFmpeg package that includes ffprobe. The official FFmpeg download page links to compiled packages for common operating systems. Confirm that ffprobe -version works in your terminal before running the script. FFmpeg: Download FFmpeg
Save the following complete program as compare_clips.py. It examines the immediate folder, creates one CSV row per ordinary video stream, and leaves the clips unchanged. The uppercase V stream selector excludes attached pictures, thumbnails and cover art. The probing options follow the official ffprobe documentation. FFmpeg: ffprobe Documentation
import csv
import json
import shutil
import subprocess
import sys
from pathlib import Path
if len(sys.argv) != 3:
raise SystemExit("Usage: python compare_clips.py FOLDER REPORT.csv")
root = Path(sys.argv[1]).expanduser().resolve()
output = Path(sys.argv[2]).expanduser()
if not root.is_dir():
raise SystemExit("FOLDER must be an existing directory")
if not shutil.which("ffprobe"):
raise SystemExit("ffprobe was not found on PATH")
extensions = {".mp4", ".mov", ".mkv", ".m4v", ".avi", ".webm", ".mts", ".mxf"}
files = sorted(p for p in root.iterdir()
if p.is_file() and p.suffix.lower() in extensions)
if not files:
raise SystemExit("No files matched the listed video extensions")
fields = ["index", "width", "height", "sample_aspect_ratio",
"display_aspect_ratio", "avg_frame_rate", "r_frame_rate",
"field_order"]
columns = ["file"] + fields + ["status"]
entries = "stream=" + ",".join(fields)
failed = 0
with output.open("x", newline="", encoding="utf-8-sig") as handle:
writer = csv.DictWriter(handle, fieldnames=columns)
writer.writeheader()
for path in files:
try:
result = subprocess.run(
["ffprobe", "-v", "error", "-select_streams", "V",
"-show_entries", entries, "-of", "json", str(path)],
capture_output=True, text=True, timeout=60, check=True)
streams = json.loads(result.stdout).get("streams", [])
if not streams:
raise ValueError("No ordinary video stream found")
for stream in streams:
row = {key: stream.get(key, "unknown") for key in fields}
row.update(file=path.name, status="OK")
writer.writerow(row)
except (subprocess.SubprocessError, ValueError, OSError) as exc:
failed += 1
writer.writerow({"file": path.name,
"status": "ERROR: " + type(exc).__name__})
print(f"{path.name}: {exc}", file=sys.stderr)
print(f"{len(files)} files examined; {failed} failed; report: {output}")
raise SystemExit(1 if failed else 0)
For example, create a folder named clips containing your videos, then run this from the directory containing the script and that folder:
python3 compare_clips.py "clips" "clip-report.csv"
On Windows, use py instead of python3 if that is your Python launcher. Choose an output filename that does not already exist: the program deliberately refuses to overwrite a report. Its output directory must already exist.
The extension list defines the scan’s scope. Add any other video extensions you use; subfolders are not included. Missing metadata remains unknown, while unsuccessful probes receive an error row and a terminal message. A timeout means that file needs another attempt or inspection, not that its dimensions or rate are zero. Multiple video streams produce multiple rows, so compare file counts separately from row counts.
The program’s syntax and the calculations below were checked with Python. End-to-end probing was not run here because ffprobe was unavailable in the research environment.
4. Sort the report into useful comparison groups
Import the CSV into a spreadsheet, keeping frame-rate and aspect-ratio columns as text. This preserves strings such as 30000/1001 and prevents automatic date or numeric formatting from obscuring them.
Review the report in this order:
- Filter
statusfor errors and resolve those files first. - Sort by
width, thenheight, to identify stored-size groups. - Compare aspect ratios within each group.
- Sort by
avg_frame_rate, keeping its original fraction visible. - Examine differing base rates, unknown fields and additional streams.
For a concise overview, make a pivot table or count groups using width, height, pixel aspect ratio and average frame rate. Keep filenames in the detailed report so every unusual group leads back to a clip you can inspect.
The following fictional report illustrates the decisions. It assumes square pixels, progressive frames and no display rotation; it is not measured output from supplied files.
| Clip | Stored dimensions | Average rate | Review against a 1080p30 sequence |
|---|---|---|---|
kite_wide.mp4 |
1920 × 1080 |
30/1 |
Matches the selected size and rate |
shapes_detail.mov |
3840 × 2160 |
30/1 |
Review scaling and composition |
kite_vertical.mp4 |
1080 × 1920 |
30/1 |
Choose borders or a deliberate crop |
shapes_turn.mp4 |
1920 × 1080 |
30000/1001 |
Review timing in the 30 fps sequence |
Equivalent fractions represent the same rate: 60/2 and 30/1 both equal 30. Preserve the originals, but account for equivalent fractions when manually consolidating groups. Conversely, 30000/1001 is approximately 29.97003, which differs from exactly 30.
5. Decide whether a dimension mismatch needs scaling or reframing
For square-pixel material with no display rotation, a 3840 × 2160 clip and a 1920 × 1080 sequence share the same 16:9 proportions. Scaling the larger image to 50% in each dimension makes its frame match the sequence. Inspect the composition afterward, especially if you also intend to reposition the image.
A vertical source requires a more deliberate choice. In the illustrative 1080 × 1920 clip, suppose the kite sits near the upper edge. Fitting the whole image inside a 1920 × 1080 sequence gives a displayed width of 1080 × (1080 ÷ 1920) = 607.5 pixels. That preserves the complete composition and leaves space at the sides.
Filling the sequence width instead gives a displayed height of 1920 × (1920 ÷ 1080) ≈ 3413.3 pixels. Much of that height lies outside the sequence frame. A centered crop may therefore remove the kite. These calculations describe the geometry; your preview determines whether the framing works.
If reported dimensions seem inconsistent with a clip’s upright appearance, check its orientation and display interpretation in the editor. The report lists stored dimensions and does not calculate a rotation-adjusted display size. Adobe identifies the Properties dialog and Project panel’s Video Info column as places to inspect dimensions and pixel aspect ratio. Adobe: Aspect ratio preservation
6. Investigate timing differences before converting clips
A single average cannot describe every frame interval. Variable-frame-rate video can change its rate during playback. HandBrake distinguishes preserving source timing from creating constant-frame-rate output; its frame-rate documentation explains these controls, although that page is marked as a draft. HandBrake Documentation: Frame rate
If a clip has unusual rate values or uneven motion in your editor, inspect its frame timestamps. This diagnostic command assumes the illustrative file clips/shapes_turn.mp4 exists and examines its first ordinary video stream:
ffprobe -v error -select_streams V:0 -show_frames -show_entries frame=best_effort_timestamp_time -of csv=p=0 "clips/shapes_turn.mp4"
ffprobe supports frame-level reporting through -show_frames. Subtract successive available timestamp values to inspect the spacing: a 30 fps interval is approximately 0.03333 seconds. Look for sustained differences beyond small timestamp rounding effects. Missing values leave the timing uncertain, and this timestamp inspection does not establish whether the pictures themselves contain repeated animation frames. FFmpeg: ffprobe Documentation
Keep separate review decisions for normal-speed playback and intentional speed changes. Do not change a source’s interpretation merely to make its report match the sequence. If your editing workflow requires constant-rate media, convert a representative clip first, then compare its duration and motion with the original. HandBrake documents that selecting a specific rate with constant-frame-rate output conforms the video to that rate. HandBrake Documentation: Frame rate
7. Check the intended result with a short sequence
Build a short test using one representative from every size-and-rate group, plus every unresolved outlier. Include moving details: the rotating wooden shape is more informative for timing than a stationary tabletop.
Check each clip at the sequence’s intended settings:
- Confirm that the complete kite or other important object remains visible throughout the shot.
- Inspect a round shape for unintended stretching.
- Review frame edges for unwanted borders or crops.
- Watch moving contours for uneven stepping, then examine individual frames if needed.
- Compare the beginning, middle and end of each suspect clip.
- Export a short sample, inspect it visually and run the report on its folder to confirm the exported dimensions and reported rates.
Treat OK in the CSV as a successful metadata probe, not a verdict on the image. A useful completed comparison gives every clip a clear disposition: ready for the sequence, needs a framing choice, needs timing investigation, or remains unresolved. Keep that report alongside the project so the decisions remain easy to revisit as new clips arrive.