Two frames sit next to each other in a video player. How much time passed between them? Dividing by the frame rate can give you the wrong answer when the spacing changes. Use FFprobe to read the presentation time of each frame in seconds, then subtract one time from the next.
You can try that with a four-frame MP4 you make yourself. Two gaps between frames are 40 milliseconds. The gap in the middle is 120 milliseconds. By the end, you’ll know which number to look at, how to check your math, and how to describe the gap without guessing what caused it.
Make a Short Video With One Longer Gap
Run the command below in an empty practice folder with FFmpeg and FFprobe available. It makes a test pattern. There’s no footage to download. This example was run on macOS using FFmpeg 8.1.2 with the libx264 encoder.
ffmpeg -f lavfi -i "testsrc2=size=320x180:rate=25:duration=0.24" -vf "select='eq(n,0)+eq(n,1)+eq(n,4)+eq(n,5)'" -fps_mode vfr -c:v libx264 -bf 0 timing-demo.mp4The source pattern produces six frames at 25 frames per second. The filter keeps source frames 0, 1, 4, and 5. We start counting at zero here because that is how the filter counts. The variable-frame-rate setting lets the output keep the longer interval between source frames 1 and 4 instead of filling it with duplicates. If you run the command again, choose a different output filename or answer the overwrite prompt for your practice file.
This is a training file with a gap we made on purpose. In an actual camera export, you rarely know in advance why the timing looks the way it does. That is what makes the exercise helpful. You can see the same symptom in a file where you already know the reason.
Read Each Frame’s Presentation Time
A presentation timestamp, or PTS, tells the player when a frame should appear on the playback timeline. FFprobe can show that value in seconds so you can compare frames without converting it yourself.
ffprobe -v error -select_streams v:0 -show_entries frame=pts_time -of default=noprint_wrappers=1:nokey=1 timing-demo.mp4Read the options in three parts. -select_streams v:0 chooses the first video stream. -show_entries frame=pts_time asks for each frame’s presentation time in seconds. The -of setting prints only the values, with a new line for each frame. -v error hides routine messages while keeping errors visible.
This clip starts at zero. If your file starts at another value, keep that first time in the notes. You can still subtract neighboring timestamps to find the interval. If you want a timeline that begins at zero for a report, record that you subtracted the first frame’s time from each value.
Read the numbers from left to right. From the first frame at 0.000 seconds to the second at 0.040 seconds, the interval is 40 milliseconds. From 0.040 to 0.160 seconds, the interval is 120 milliseconds. The last interval goes back to 40 milliseconds. Multiply seconds by 1,000 if you want milliseconds. The value 0.160 seconds tells you where a frame sits in playback. The value 120 milliseconds tells you how far apart two frames are.
Why the Average Frame Rate Won’t Give You That Gap
The stream summary describes the clip as a whole. Run this on the same file:
ffprobe -v error -select_streams v:0 -show_entries stream=r_frame_rate,avg_frame_rate,time_base -of default=nw=1 timing-demo.mp4In our run, the average frame rate was 50/3, or about 16.67 frames per second. Using one divided by that average gives an interval of about 60 milliseconds. None of the neighboring pairs we measured were 60 milliseconds apart. The per-frame times answer the question here.
The time_base is a separate value. It tells you the length of one timestamp tick. Here it was 1/12800 of a second. If a tool gives you an integer PTS of 2048 ticks for frame 3, you can get 0.160 seconds by dividing by 12,800. Prefer pts_time when it’s available, and keep the original values if you need another examiner to check your work.
Keep Playback Time Separate From the Camera Clock
A PTS of 0.160 seconds tells you where a frame should appear in the video. It doesn’t tell you what time of day the camera recorded it. A timestamp printed in the corner of the picture, a date in the file metadata, and the playback timeline can come from different sources.
If you need to place a frame at a real-world time, first find a reliable clock reference. Record where it came from and whether a time zone or clock offset applies. An exported clip can begin midway through the original recording. Its first playback time may be zero even if the event starts much later than the camera recording itself. The video authentication and integrity lesson explains how to compare those records.
What to Check if Your Output Looks Different
- If there are no video rows, check that FFprobe can open the file and that you chose the intended stream. Some files contain more than one video stream.
- If you see missing timestamp values, keep the gaps in your notes. If you inspect
best_effort_timestamp_timeas well, record which field you used. It may reflect a timing estimate made during decoding. - If your tool shows DTS, that is related to when data should be decoded. Some video formats store pictures in a different order from the one you see. Use the presentation time for this playback comparison.
- If the clip has been exported or re-encoded, check the version you received and save its identity in your notes. Export settings can change how frames are timed.
Write Down What You Can See in the File
For this lab, you could write: “In timing-demo.mp4, frame 2 has a presentation time of 0.040 seconds and frame 3 has a presentation time of 0.160 seconds. The interval between them is 0.120 seconds. The adjacent intervals in the same clip are 0.040 seconds.”
That sentence gives a second reader enough detail to repeat the check. In casework, add the file ID, the stream you read, the tool version, and the field name. A large interval is an observation about playback timing. Before drawing a conclusion about missing pictures, consider how the file was recorded, exported, and encoded. Use the frame deletion and insertion lesson to see what additional checks can support that interpretation.
Try writing the same note for the last two frames. You should find a 40-millisecond interval. Once you can explain where that number came from, you can do the same comparison in a longer clip.