CleanScrape 的 Video Frame Extractor 從 14:48 的 Sintel 抽取 166 個鏡頭畫面
Every cut in a 15-minute film: extracting 166 scene frames from a video link
CleanScrape 開發的 Video Frame Extractor 可從影片連結抽取每個鏡頭的一張畫面並附上準確時間;在 14:48 的 Sintel 上找到 166 個鏡頭,耗時 3 分 22 秒。
If you want to send a video to an AI vision model, build a thumbnail picker, or index a lecture by its slides, you rarely want every frame. You want one frame per shot. So I built a small tool on Apify that takes a video link and returns those frames as images, with their exact times.
Here is what it does on Sintel, the 14:48 open movie from the Blender Foundation.
The input
{
"videos": ["https://archive.org/download/Sintel/sintel-2048-stereo.mp4"],
"mode": "scenes",
"contactSheet": true
}
It found 166 shots and saved one frame for each. The scan took 3 minutes 22 seconds.
How it finds the cuts
In this precise mode it compares every frame with the one before. When the picture changes completely, that is a cut, and a frame is saved there. When the camera only pans or zooms, the picture changes a little at a time; that is not counted as a cut. (An earlier version did count fast camera moves, which is how I learned to require a sharp peak rather than a large change.)
When you don't need every cut
Overview mode reads only the keyframes, the full pictures a video file stores every few seconds. On the same film it returned 24 frames in 21 seconds.
Slides and screen recordings
On a 60-second lecture recording with a moving mouse pointer, precise mode with high sensitivity found all 6 slides (at 0:00, 0:10, 0:20, 0:30, 0:40 and 0:50) and ignored the pointer.
What you get
Every frame comes with its time, timecode, size and an image link (JPG, PNG or WebP), and every video gets a contact sheet: all its frames on one page. Other modes: a frame every N seconds, a set number of evenly spaced frames, or exact timestamps.
It reads MP4, MOV, WebM, MKV, AVI, MPEG-TS, OGV and animated GIF from direct links, S3 and other storage links, Dropbox and Google Drive.
Try it
https://apify.com/cleanscrape/video-frame-extractor
$2 per 1,000 frames, $0.005 per video, and in precise mode $0.01 per minute of 1080p video at 30 fps (smaller videos count less): the 166-frame Sintel run costs about $0.45, the overview run about $0.05. Use it on videos you own or may use.
Sintel © Blender Foundation, durian.blender.org, CC BY 3.0.
Niko, CleanScrape developer
來源:DEV Community · dev.to