跳到正文
DEV Community· Joey·· 4 天前AI 評分52

如何用 ffprobe 檢查 AI 生成影片的實際時長

How I Check an AI-Generated Video with ffprobe

AI 導讀

作者用 ffprobe 檢查在 Astorie 生成的 MP4,發現整個檔案長 8.064 秒,比八秒上載限制多 64 毫秒。影片串流時長為 8.041667 秒,畫面為 1280 × 720、24 fps;文章提供 ffprobe 命令,並提醒以整個檔案時長核對限制。

正文

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

Joey

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"

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.

來源:DEV Community · dev.to