I generated a skiing clip in Astorie and downloaded it as an MP4. Windows Properties showed eight seconds. Before dropping it into an edit, I wanted to know exactly how long it ran.
GIF preview of the skiing clip I generated in Astorie. I ran the check below on the original MP4.
With ffprobe installed, run this command from the folder containing your MP4. Replace the filename to check another clip.
ffprobe -v error -select_streams v:0 -show_entries "stream=width,height,avg_frame_rate,duration:format=duration" "astorie - Video-1-03.mp4"
My clip came back at 1280 × 720 and 24 fps. In the output, [STREAM] showed a video duration of 8.041667 seconds. [FORMAT] showed 8.064 seconds for the whole MP4.
Say I need the clip to fit an eight-second slot. Windows shows 00:00:08, but the picture runs about 42 ms over. If eight seconds is an upload limit, I’d check the whole file. This MP4 runs 64 ms over that limit.

Top comments (2)
8.041667 s at 24 fps is exactly 193 frames, so the picture is one whole frame over, not a fuzzy 42 ms. If the MP4 has an audio track, the extra bit in [FORMAT] usually comes from there: AAC is written in blocks of 1024 samples (about 21 ms at 48 kHz), so the audio can end a block after the last frame. Dropping -select_streams v:0 and asking for stream=codec_type,duration shows which stream sets the file length. When we join short clips we trim by frame count (-frames:v 192) rather than by seconds, so the one-frame overruns don't add up across cuts.
Nice clear check. One step further if you need to land exactly on 8.000s: count the frames rather than trusting the duration fields. ffprobe -v error -count_frames -select_streams v:0 -show_entries stream=nb_read_frames "file.mp4" should give 193 at 24 fps, which is where the 8.0417 comes from. Re-encoding with -frames:v 192 gives you exactly 8.000s of picture. The 8.064 in [FORMAT] is usually the audio stream running long (AAC frames are about 21 ms each, plus encoder priming), so run the same check with -select_streams a:0. If the audio is the long one, add -t 8 when you trim, or the upload limit still sees the longer file.