On this page |
Overview
The opposite operation (compile frame images into a video) is in the FFmpeg encode video node.
You can use this node two ways:
-
With no inputs, specify a video file to extract images from.
-
If the node has incoming work items with
output
s representing video files, the node will extract for each incoming work item. Set the Video parameter to&96;@pdg_input&96;
to use each incoming item’s output result file as the input for the frame extraction.
This node generates one work item to extract all images for each input video. (It does not generate separate work items for each frame.) The output
of the work item is an array of output file names. If you want to wire the output to nodes that expect separate work items per file, use the Work Item Expand node to split out the output files in the work item(s).
Installation
This node is a wrapper around the ffmpeg
command line tool. You must have FFmpeg installed on each machine for this node to work.
-
You can specify an explicit path to the executable using the node’s
-
If the FFmpeg path parameter is blank, the node looks for the environment variable
PDG_FFMPEG
, which if defined should contain a path to the executable. -
If the
PDG_FFMPEG
variable is not defined, the node will assume the executable is in the system path.
TOP Attributes
|
string |
Indicates the ffmpeg operation ( |
|
string |
File path to the video to extract from. |
|
integer |
Whether the user specified a custom |
|
string |
The path to the |
|
integer |
The number of frames to extract per second of video. |
|
integer |
If this is |
|
integer |
The width of the output images, if |
|
integer |
The height of the output images, if |
|
string |
A pattern string (using FFmpeg-specific |
|
integer |
When this is |
|
string |
A custom command line to run, when |
|
outputtag |
TThe file tag to put on the result file paths. |
Parameters
Node
Video
File path of the video file to extract frames from.
Frames Per Second
How many times a second to sample the video to generate an output image. Higher numbers generate more frame images.
Width
When the checkbox next to width/height is on, this specifies a custom width for the output images. Otherwise the node uses the video’s native size.
Height
When the checkbox next to width/height is on, this specifies a custom height for the output images. Otherwise the node uses the video’s native size.
Image Output Pattern
The string to use to generate output image file paths. This can include @expressions
(inside backticks because it’s a string parameter), and it must include exactly one FFmpeg-specific %d
marker for where to put the frame number. You can pad the frame number with leading zeros, for example %04d
to pad the frame number to 4 digits. You can use the drop-down menu at the end of the textbox to choose between different preset patterns.
Output File Tag
FFmpeg Command
Turn this on to customize the command line passed to ffmpeg
.
FFmpeg Path
Turn this on to set an explicit path to the ffmpeg
executable.
If this is off, the node will look for a PDG_FFMPEG
environment variable.
If the variable is not set, the node will simply assume the executable is on the system path.
Processor
Work Item Generation
Whether this node generates static or dynamic work items. You should generally leave this set to "Automatic" unless you know the node’s work items can be computed statically, or that they need to be generated dynamically.
Dynamic
This node always creates dynamic work items: it waits until the upstream work items are known, and generates new work items from the upstream work items.
Static
This node always creates static work items: it creates the number of work items it thinks it needs based on the parameters (and any upstream static items) before the network runs.
Automatic
If the input is static (a static processor, or a partitioner with only static inputs, or a mapper), this node generates static work items, otherwise it generates dynamic work items.
Examples
example_top_ffmpegextractimages Example for FFmpeg Extract Images TOP node
This example demonstrates how to use FFmpeg Extract Images node to extract images from a video file.
See also |