components.io.videofilewriter2
- class VideoFileWriter2(config={}, **kwds)[source]
Bases:
Component
Write video files, including “raw” format.
This component uses FFmpeg to write video to a variety of formats. Make sure you have installed FFmpeg before attempting to use
VideoFileWriter2
.There are two configuration settings that control the saved file format.
codec
chooses a codec “family” such as'FFV1'
andpix_fmt
chooses the data layout before compression. The “container” format, such asAVI
orMOV
, is inferred from the file name extension. Not all codecs will work with all pixel formats, and FFmpeg supports many more pixel formats (and codecs) that are available inVideoFileWriter2
. Let me know if you have any particular requirements that are not already included.The
raw
andffv1
codecs are lossless, but look out for unwanted RGB<->YUV conversion or UV resampling.H264
always converts to YUV,H264rgb
always converts to RGB.The
input_Y_RGB
input accepts images with 1 or 3 components as Y or RGB. Theinput_UV
input accepts UV images with 2 components. Theinput
config specifies the expected inputs.Config
path
str
Path name of file to be written.
input
str
The input video format. Can be
'RGB'
,'YUV'
, or'Y'
.codec
str
Codec name. Possible values:
'raw'
,'FFV1'
,'H264'
,'H264rgb'
.pix_fmt
str
Pixel format. Possible values:
'rgb24'
,'rgb48le'
,'uyvy422'
,'yuv422p'
,'yuv422p10le'
,'gray'
,'gray16le'
.fps
int
Video frame rate. Only affects how file is replayed.
- inputs = ['input_Y_RGB', 'input_UV']
Comments or questions? Please email jim@jim-easterbrook.me.uk.