Search - User list
Full Version: FFmpeg Extract Images – output only one frame?
Root » PDG/TOPs » FFmpeg Extract Images – output only one frame?
amaruki
Is it possible to make the ffmpegextractimages node output just a single image instead of the whole frame range?

I followed the example from the documentation (https://www.sidefx.com/docs/houdini/nodes/top/ffmpegextractimages.html), and if I change the Output File Pattern from frame%06d.jpg to frame.jpg, it actually works and saves one image. However, the node shows as failed in the TOP network, which is a bit annoying.

Is there a proper way to do this? I’m completely new to TOPs, so any guidance would be appreciated!
amaruki
So my solution so far is to add ffmpeg expressions to the FF mpeg Command parameter on the ffmpegextractimages node.

I got these variations working so far:

Extract first frame: -frames:v 1

Extract specific frame (frame 150 in my example): -vf "fps=24,select='eq(n,150)'" -vframes 1

Extract one frame at specific time (at five seconds in my example): -ss 00:00:05 -vframes 1

Bonus to set the best quality on image: -q:v 1


Example of the full FFmpeg Command for extracting the first frame:

__PDG_HFS__/bin/hffmpeg -i "`pdginput(0, file/video, 0)`" -vf fps=24 -frames:v 1 -q:v 1 "$HIP/output/images/shot01_frame01.jpg"
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB