How to capture screenshots from a video clip 50 minutes into the clip and do it fast?
Asked Answered
H

1

5

Ok it seems that whenever I tell ffmpeg to take a screen cap half way though the clip (clip can be as long as 10 hours) it uses 100% of 1 cpu core and takes ages… whereas if I let it do a frame at the start it goes real quick, as if it scans though the video to get to the middle instead of just jumping to it!

Here is the code im currently using:

ffmpeg -y -itsoffset -“500"  -i “clipname.mov" -vcodec png -vframes 1 -an -f rawvideo “clipScreenshot001.png”

This can take several minutes.

These are HD videos too, 720p/1080p and allot of the time they are raw unedited clips (e.g. very long).

So I was hoping for some better software that will make screen captures from video much faster (has to be linux and scriptable).

Homy answered 2/2, 2010 at 10:8 Comment(2)
I found this => fengcool.com/2008/12/… It might help you with your problem.Affrica
Probably your video does not contain enough reference frames or are not indexed. Capturing a frame far forward into the stream will always require a complete scan and decoding: IO intensive and computation costly. It always takes very long. Unless you prepare it in advance, you need to process the video at least once. Essentially you can either (1)reencode the video with another format with reference frames indexed (.avi mpeg for example) you can later capture screen at the desired spots much faster. Or, (2) you can capture, say one per second, and keep all the captured screens.Graniah
C
7

Try to use seek (the -ss flag) instead of delaying (the -itsoffset), i.e.:

ffmpeg -y -ss 3000 -i "clipname.mov" -vframes 1 "clipScreenshot001.png"
Caitlin answered 10/2, 2010 at 14:7 Comment(1)
huh, I thought I had tried that, guess not. It now makes a screenshot in under a second which would take about 5 minutes before, THANK YOU! To be honest I didn't think anyone would figure this question out, but Im one happy guy now that it is (and my CPU thanks you too :))Homy

© 2022 - 2024 — McMap. All rights reserved.