DEV Community

Cover image for How I Check an AI-Generated Video with ffprobe
Joey
Joey

Posted on

How I Check an AI-Generated Video with ffprobe

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.

A skier carves down a snowy slope, sending up a trail of powder.

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"
Enter fullscreen mode Exit fullscreen mode

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 (0)