WriteFFmpeg node

pluginIcon

This documentation is for version 1.0 of WriteFFmpeg.

Description

Write a video sequence using FFmpeg.

This plugin can be used to produce entheir digital intermediates, i.e. videos with very high resolution and quality which can be read frame by frame for further processing, or highly compressed videos to distribute on the web. Note that this plug-in does not support audio, but audi can easily be added to the video using the ffmpeg command-line tool (see note below). In a VFX context, it is often preferable to save processed images as a sequence of individual frames (using WriteOIIO), if disk space and real-time playing are not an issue.

The preferred pixel coding (Pref. Pixel Coding) and bit depth (Pref. Bit Depth) can be selected. This is especially useful for codecs that propose multiple pixel formats (e.g. ffv1, ffvhuff, huffyuv, jpeg2000, mjpeg, mpeg2video, vc2, libopenjpeg, png, qtrle, targa, tiff, libschroedinger, libtheora, libvpx, libvpx-vp9, libx264, libx265).

The pixel format is selected from the available choices for the chosen codec using the following rules:

  • First, try to find the format with the smallest BPP (bits per pixel) that fits into the preferences.
  • Second, If no format fits, get the format that has a BPP equal or a bit higher that the one computed from the preferences.
  • Last, if no such format is found, get the format that has the highest BPP.

The selected pixel coding, bit depth, and BPP are displayed in the Selected Pixel Coding, Bit Depth, and BPP parameters.

The recommended Container/Codec configurations for encoding digital intermediates are (see also https://trac.ffmpeg.org/wiki/Encode/VFX):

  • QuickTime with ProRes: all ProRes profiles are 10-bit and are intra-frame (each frame is encoded separately). Prores 4444 can also encode the alpha channel.
  • QuickTime with VC3/DNxHD/DNxHR: the codec is intra-frame. DNxHR profiles are resolution-independent, but are still only available with 8-bit depth. The alpha channel cannot be encoded.
  • MP4 (or QuickTime) with Photo JPEG and Global Quality set to 1: intra-frame and 8-bit. qscale=1 ensure almost lossless encoding.
  • MP4 (or QuickTime) with avc1 (libx264 or libx264rgb) and Output Quality set to Lossless or Perceptually Lossless: 10-bit(*), and can be made intra-frame by setting Keyframe Interval to 1 and Max B-Frames to 0. Lossless may not be playable in real-time for high resolutions. Set the Encoding Speed to Ultra Fast for faster encoding but worse compression, or Very Slow for best compression.

(*) The H.264 output may be 8-bit if libx264 was not compiled with 10-bit support. Check the information displayed in the Bit Depth field.

To write videos intended for distribution (as media files or for streaming), the most popular codecs are mp4v (mpeg4 or libxvid), avc1 (libx264), hev1 (libx265), VP80 (libvpx) and VP90 (libvpx-vp9). The quality of mp4v may be set using the Global Quality parameter (between 1 and 31, 1 being the highest quality), and the quality of avc1, hev1, VP80 and VP90 may be set using the Output Quality parameter. More information can be found at https://trac.ffmpeg.org/wiki#Encoding

If the output video should be encoded with specific FFmpeg options, such as a given pixel format or encoding option, it is better to write the output as individual frames in an image format that has a sufficient bit depth, and to encode the set of individual frames to a video using the command-line ffmpeg tool.

The settings for the “Global Quality” and “Quality” parameters may have different meanings for different codecs. See http://slhck.info/video/2017/02/24/vbr-settings.html for a summary of recommended values. Using these settings should be preferred over constant bitrate-based encoding, as it usually gives a much better result.

Adding audio

If synchronized audio is available as a separate file, encoded with the right codec, it can be easily added to the video using a command like: ffmpeg -i input.mp4 -i input.mp3 -c copy -map 0:0 -map 1:0 output.mp4 (in this example, input.mp4 contains the video, input.mp3 contains the audio, and output.mp4 co,ntains both tracks).

This command does not re-encode the video or audio, but simply copies the data from each source file and places it in separate streams in the output.

Inputs

Input Description Optional
Source   No

Controls

Parameter / script name Type Default Function
Output Components / outputComponents Choice RGBA Map the input layer to this type of components before writing it to the output file.
File / filename N/A   The output image sequence/video stream file(s). The string must match the following format: path/sequenceName###.ext where the number of # (hashes) will define the number of digits to append to each file. For example path/mySequence###.jpg will be translated to path/mySequence000.jpg, path/mySequence001.jpg, etc. %d printf-like notation can also be used instead of the hashes, for example path/sequenceName%03d.ext will achieve the same than the example aforementionned. there will be at least 2 digits). The file name may not contain any # (hash) in which case it will be overriden everytimes. Views can be specified using the “long” view notation %V or the “short” notation using %v.
Format Type / formatType Choice Project Format
Determines which rectangle of pixels will be written in output.
Input Format: Renders the pixels included in the input format
Project Format: Renders the pixels included in the project format
Fixed Format: Renders the pixels included in the format indicated by the Format parameter.
Format / NatronParamFormatChoice Choice HD 1920x1080 The output format to render
OCIO Config File / ocioConfigFile N/A   OpenColorIO configuration file
Input Colorspace / ocioInputSpaceIndex Choice   Input data is taken to be in this colorspace.
File Colorspace / ocioOutputSpaceIndex Choice   Output data is taken to be in this colorspace.
key1 / key1 String  
OCIO Contexts allow you to apply specific LUTs or grades to different shots.
Here you can specify the context name (key) and its corresponding value.
Full details of how to set up contexts and add them to your config can be found in the OpenColorIO documentation:
value1 / value1 String  
OCIO Contexts allow you to apply specific LUTs or grades to different shots.
Here you can specify the context name (key) and its corresponding value.
Full details of how to set up contexts and add them to your config can be found in the OpenColorIO documentation:
key2 / key2 String  
OCIO Contexts allow you to apply specific LUTs or grades to different shots.
Here you can specify the context name (key) and its corresponding value.
Full details of how to set up contexts and add them to your config can be found in the OpenColorIO documentation:
value2 / value2 String  
OCIO Contexts allow you to apply specific LUTs or grades to different shots.
Here you can specify the context name (key) and its corresponding value.
Full details of how to set up contexts and add them to your config can be found in the OpenColorIO documentation:
key3 / key3 String  
OCIO Contexts allow you to apply specific LUTs or grades to different shots.
Here you can specify the context name (key) and its corresponding value.
Full details of how to set up contexts and add them to your config can be found in the OpenColorIO documentation:
value3 / value3 String  
OCIO Contexts allow you to apply specific LUTs or grades to different shots.
Here you can specify the context name (key) and its corresponding value.
Full details of how to set up contexts and add them to your config can be found in the OpenColorIO documentation:
key4 / key4 String  
OCIO Contexts allow you to apply specific LUTs or grades to different shots.
Here you can specify the context name (key) and its corresponding value.
Full details of how to set up contexts and add them to your config can be found in the OpenColorIO documentation:
value4 / value4 String  
OCIO Contexts allow you to apply specific LUTs or grades to different shots.
Here you can specify the context name (key) and its corresponding value.
Full details of how to set up contexts and add them to your config can be found in the OpenColorIO documentation:
OCIO config help... / ocioHelp Button   Help about the OpenColorIO configuration.
Input Premult / inputPremult Choice PreMultiplied
Input is considered to have this premultiplication state.
If it is Premultiplied, red, green and blue channels are divided by the alpha channel before applying the colorspace conversion.
This is set automatically from the input stream information, but can be adjusted if this information is wrong.
Opaque: The image is opaque and so has no premultiplication state, as if the alpha component in all pixels were set to the white point.
PreMultiplied: The image is premultiplied by its alpha (also called “associated alpha”).
UnPreMultiplied: The image is unpremultiplied (also called “unassociated alpha”).
Clip Info... / clipInfo Button   Display information about the inputs
Frame Range / frameRange Choice Project frame range
What frame range should be rendered.
Union of input ranges: The union of all inputs frame ranges will be rendered.
Project frame range: The frame range delimited by the frame range of the project will be rendered.
Manual: The frame range will be the one defined by the first frame and last frame parameters.
First Frame / firstFrame Integer 0  
Last Frame / lastFrame Integer 0  
Container / format Choice guess from filename
Output format/container.
AVI (Audio Video Interleaved) [avi]: Compatible with ayuv, cinepak, ffv1, ffvhuff, flv, h263p, huffyuv, jpeg2000, jpegls, ljpeg, mjpeg, mpeg2video, mpeg4, msmpeg4v2, msmpeg4, png, svq1, targa, v308, v408, v410, vc2, libopenjpeg, libschroedinger, libtheora, libvpx, libvpx-vp9, libx264, libx264rgb, libxvid.
FLV (Flash Video) [flv]: Compatible with flv, mpeg4, libx264, libx264rgb, libxvid.
Matroska [matroska]: Compatible with prores_ksap4h, prores_ksapch, prores_ksapcn, prores_ksapcs, prores_ksapco, ffv1, mjpeg, mpeg2video, mpeg4, msmpeg4, vc2, libschroedinger, libtheora, libvpx, libvpx-vp9, libx264, libx264rgb, libx265, libxvid.
QuickTime / MOV [mov]: Compatible with prores_ksap4h, prores_ksapch, prores_ksapcn, prores_ksapcs, prores_ksapco, avrp, cinepak, dnxhd, jpeg2000, mjpeg, mpeg2video, mpeg4, msmpeg4, png, qtrle, svq1, targa, tiff, v308, v408, v410, vc2, libopenjpeg, libschroedinger, libvpx-vp9, libx264, libx264rgb, libx265, libxvid.
MP4 (MPEG-4 Part 14) [mp4]: Compatible with jpeg2000, mjpeg, mpeg2video, mpeg4, png, vc2, libopenjpeg, libschroedinger, libvpx-vp9, libx264, libx264rgb, libx265, libxvid.
MPEG-1 Systems / MPEG program stream [mpeg]: Compatible with libx264, libx264rgb.
MPEG-TS (MPEG-2 Transport Stream) [mpegts]: Compatible with mpeg2video, mpeg4, vc2, libschroedinger, libx264, libx264rgb, libx265, libxvid.
Ogg Video [ogv]: Compatible with libtheora.
3GP2 (3GPP2 file format) [3g2]: Compatible with mpeg4, libx264, libx264rgb, libxvid.
3GP (3GPP file format) [3gp]: Compatible with mpeg4, libx264, libx264rgb, libxvid.
Codec / codec Choice ap4h Apple ProRes 4444
Output codec used for encoding. The general recommendation is to write either separate frames (using WriteOIIO), or an uncompressed video format, or a “digital intermediate” format (ProRes, DNxHD), and to transcode the output and mux with audio with a separate tool (such as the ffmpeg or mencoder command-line tools).
The FFmpeg encoder codec name is given between brackets at the end of each codec description.
Please refer to the FFmpeg documentation http://ffmpeg.org/ffmpeg-codecs.html for codec options.
ap4h Apple ProRes 4444: Compatible with matroska, mov.
apch Apple ProRes 422 HQ: Compatible with matroska, mov.
apcn Apple ProRes 422: Compatible with matroska, mov.
apcs Apple ProRes 422 LT: Compatible with matroska, mov.
apco Apple ProRes 422 Proxy: Compatible with matroska, mov.
AVrp Avid 1:1 10-bit RGB Packer [avrp]: Compatible with mov.
AYUV Uncompressed packed MS 4:4:4:4 [ayuv]: Compatible with avi.
cvid Cinepak [cinepak]: Compatible with avi, mov.
AVdn Avid DNxHD / DNxHR / SMPTE VC-3 [dnxhd]: Compatible with mov.
FFV1 FFmpeg video codec #1 [ffv1]: Compatible with avi, matroska.
FFVH Huffyuv FFmpeg variant [ffvhuff]: Compatible with avi.
FLV1 FLV / Sorenson Spark / Sorenson H.263 (Flash Video) [flv]: Compatible with avi, flv.
H263 H.263+ / H.263-1998 / H.263 version 2 [h263p]: Compatible with avi.
HFYU HuffYUV [huffyuv]: Compatible with avi.
mjp2 JPEG 2000 [jpeg2000]: Compatible with avi, mov, mp4.
MJLS JPEG-LS [jpegls]: Compatible with avi.
LJPG Lossless JPEG [ljpeg]: Compatible with avi.
jpeg Photo JPEG [mjpeg]: Compatible with avi, matroska, mov, mp4.
m2v1 MPEG-2 Video [mpeg2video]: Compatible with avi, matroska, mov, mp4, mpegts.
mp4v MPEG-4 part 2 [mpeg4]: Compatible with avi, flv, matroska, mov, mp4, mpegts, 3g2, 3gp.
MP42 MPEG-4 part 2 Microsoft variant version 2 [msmpeg4v2]: Compatible with avi.
3IVD MPEG-4 part 2 Microsoft variant version 3 [msmpeg4]: Compatible with avi, matroska, mov.
png PNG (Portable Network Graphics) image [png]: Compatible with avi, mov, mp4.
rle QuickTime Animation (RLE) video [qtrle]: Compatible with mov.
SVQ1 Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1 [svq1]: Compatible with avi, mov.
tga Truevision Targa image [targa]: Compatible with avi, mov.
tiff TIFF image [tiff]: Compatible with mov.
v308 Uncompressed 8-bit 4:4:4 [v308]: Compatible with avi, mov.
v408 Uncompressed 8-bit QT 4:4:4:4 [v408]: Compatible with avi, mov.
v410 Uncompressed 4:4:4 10-bit [v410]: Compatible with avi, mov.
drac SMPTE VC-2 (previously BBC Dirac Pro) [vc2]: Compatible with avi, matroska, mov, mp4, mpegts.
mjp2 OpenJPEG JPEG 2000 [libopenjpeg]: Compatible with avi, mov, mp4.
drac SMPTE VC-2 (previously BBC Dirac Pro) [libschroedinger]: Compatible with avi, matroska, mov, mp4, mpegts.
theo Theora [libtheora]: Compatible with avi, matroska, ogv.
VP80 On2 VP8 [libvpx]: Compatible with avi, matroska.
VP90 Google VP9 [libvpx-vp9]: Compatible with avi, matroska, mov, mp4.
avc1 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [libx264]: Compatible with avi, flv, matroska, mov, mp4, mpeg, mpegts, 3g2, 3gp.
avc1 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB [libx264rgb]: Compatible with avi, flv, matroska, mov, mp4, mpeg, mpegts, 3g2, 3gp.
hev1 H.265 / HEVC (High Efficiency Video Coding) [libx265]: Compatible with matroska, mov, mp4, mpegts.
mp4v MPEG-4 part 2 [libxvid]: Compatible with avi, flv, matroska, mov, mp4, mpegts, 3g2, 3gp.
Codec Name / codecShortName String   The codec used when the writer was configured. If this parameter is visible, this means that this codec may not be supported by this version of the plugin.
FPS / fps Double 24 File frame rate
Reset FPS / resetFps Button   Reset FPS from the input FPS.
Pref. Pixel Coding / prefPixelCoding Choice YUV422
Preferred pixel coding.
YUV420: 1 Cr & Cb sample per 2x2 Y samples.
YUV422: 1 Cr & Cb sample per 2x1 Y samples.
YUV444: 1 Cr & Cb sample per Y sample.
RGB: Separate r, g, b.
XYZ: CIE XYZ compressed with gamma=2.6, used for Digital Cinema.
Bit Depth / prefBitDepth Choice 8 Preferred bit depth (number of bits per component).
Alpha / enableAlpha Boolean Off If checked, and the input contains alpha, formats with an alpha channel are preferred.
Show Avail. / prefShow Button   Show available pixel codings for this codec.
DNxHD Codec Profile / DNxHDCodecProfile Choice DNxHR HQ
Only for the Avid DNxHD codec, select the target bit rate for the encoded movie. The stream may be resized to 1920x1080 if resolution is not supported. Writing in thin-raster HDV format (1440x1080) is not supported by this plug-in, although FFmpeg supports it.
DNxHR HQ: DNxHR High Quality (8 bit, 4:2:2 chroma sub-sampling, 4.5:1 compression)
DNxHR SQ: DNxHR Standard Quality (8 bit, 4:2:2 chroma sub-sampling, 7:1 compression)
DNxHR LB: DNxHR Low Bandwidth (8 bit, 4:2:2 chroma sub-sampling, 22:1 compression)
DNxHD 422 10-bit 440Mbit: 880x in 1080p/60 or 1080p/59.94, 730x in 1080p/50, 440x in 1080p/30, 390x in 1080p/25, 350x in 1080p/24
DNxHD 422 10-bit 220Mbit: 440x in 1080p/60 or 1080p/59.94, 365x in 1080p/50, 220x in 1080i/60 or 1080i/59.94, 185x in 1080i/50 or 1080p/25, 175x in 1080p/24 or 1080p/23.976, 220x in 1080p/29.97, 220x in 720p/59.94, 175x in 720p/50
DNxHD 422 8-bit 220Mbit: 440 in 1080p/60 or 1080p/59.94, 365 in 1080p/50, 220 in 1080i/60 or 1080i/59.94, 185 in 1080i/50 or 1080p/25, 175 in 1080p/24 or 1080p/23.976, 220 in 1080p/29.97, 220 in 720p/59.94, 175 in 720p/50
DNxHD 422 8-bit 145Mbit: 290 in 1080p/60 or 1080p/59.94, 240 in 1080p/50, 145 in 1080i/60 or 1080i/59.94, 120 in 1080i/50 or 1080p/25, 115 in 1080p/24 or 1080p/23.976, 145 in 1080p/29.97, 145 in 720p/59.94, 115 in 720p/50
DNxHD 422 8-bit 36Mbit: 90 in 1080p/60 or 1080p/59.94, 75 in 1080p/50, 45 in 1080i/60 or 1080i/59.94, 36 in 1080i/50 or 1080p/25, 36 in 1080p/24 or 1080p/23.976, 45 in 1080p/29.97, 100 in 720p/59.94, 85 in 720p/50
Selected Pixel Coding / infoPixelFormat String   Pixel coding of images passed to the encoder. If several pixel codings are available, the coding which causes less data loss is selected. Other pixel formats may be available by transcoding with ffmpeg on the command-line, as can be seen by executing ‘ffmpeg –help encoder=codec_name’ on the command-line.
Bit Depth / infoBitDepth Integer 0 Bit depth (number of bits per component) of the pixel format.
BPP / infoBpp Integer 0 Bits per pixel of the pixel format.
DNxHD Output Range / DNxHDEncodeVideoRange Choice Video Range
When encoding using DNxHD this is used to select between full scale data range and ‘video/legal’ data range.
Full scale data range is 0-255 for 8-bit and 0-1023 for 10-bit. ‘Video/legal’ data range is a reduced range, 16-240 for 8-bit and 64-960 for 10-bit.
Output Quality / crf Choice Medium Quality
Constant Rate Factor (CRF); tradeoff between video quality and file size. Used by avc1, hev1, VP80, VP9, and CAVS codecs.
Option -crf in ffmpeg.
None: Use constant bit-rate rather than constant output quality
Lossless: Corresponds to CRF = 0.
Perceptually Lossless: Corresponds to CRF = 17.
High Quality: Corresponds to CRF = 20.
Medium Quality: Corresponds to CRF = 23.
Low Quality: Corresponds to CRF = 26.
Very Low Quality: Corresponds to CRF = 29.
Encoding Speed / x26xSpeed Choice Medium
Trade off performance for compression efficiency. Available for avc1 and hev1.
Option -preset in ffmpeg.
Ultra Fast: Fast encoding, but larger file size.
Very Slow: Slow encoding, but smaller file size.
Global Quality / qscale Double -1
For lossy encoding, this controls image quality, from 0 to 100 (the lower, the better, 0 being near-lossless). For lossless encoding, this controls the effort and time spent at compressing more. -1 or negative value means to use the codec default or CBR (constant bit rate). Used for example by FLV1, mjp2, theo, jpeg, m2v1, mp4v MP42, 3IVD, codecs.
Option -qscale in ffmpeg.
Quality / quality Integer min: -1 max: -1
The quality range the codec is allowed to vary the image data quantiser between to attempt to hit the desired bitrate. The lower, the better: higher values mean increased image degradation is possible, but with the upside of lower bit rates. Only supported by certain codecs (e.g. VP80, VP90, avc1, but not hev1 or mp4v).
-1 means to use the codec default.
Options -qmin and -qmax in ffmpeg.
Bitrate / bitrateMbps Double 185
The target bitrate the codec will attempt to reach (in Megabits/s), within the confines of the bitrate tolerance and quality min/max settings. Only supported by certain codecs (e.g. hev1, m2v1, MP42, 3IVD, but not mp4v, avc1 or H264).
Option -b in ffmpeg (multiplied by 1000000).
Bitrate Tolerance / bitrateToleranceMbps Double 0
Set video bitrate tolerance (in Megabits/s). In 1-pass mode, bitrate tolerance specifies how far ratecontrol is willing to deviate from the target average bitrate value. This is not related to min/max bitrate. Lowering tolerance too much has an adverse effect on quality. As a guideline, the minimum slider range of target bitrate/target fps is the lowest advisable setting. Anything below this value may result in failed renders.
Only supported by certain codecs (e.g. MP42, 3IVD, but not avc1, hev1, m2v1, mp4v or H264).
A reasonable value is 5 * bitrateMbps / fps.
Option -bt in ffmpeg (multiplied by 1000000).
Keyframe Interval / gopSize Integer -1
The keyframe intervale, also called GOP size, specifies how many frames may be grouped together by the codec to form a compression GOP. Exercise caution with this control as it may impact whether the resultant file can be opened in other packages. Only supported by certain codecs.
-1 means to use the codec default if bFrames is not 0, or 1 if bFrames is 0 to ensure only intra (I) frames are produced, producing a video which is easier to scrub frame-by-frame.
Option -g in ffmpeg.
Max B-Frames / bFrames Integer -1
Set max number of B frames between non-B-frames. Must be an integer between -1 and 16. 0 means that B-frames are disabled. If a value of -1 is used, it will choose an automatic value depending on the encoder. Influences file size and seekability. Only supported by certain codecs.
-1 means to use the codec default if Keyframe Interval is not 1, or 0 if Keyframe Interval is 1 to ensure only intra (I) frames are produced, producing a video which is easier to scrub frame-by-frame.
Option -bf in ffmpeg.
Write NCLC / writeNCLC Boolean On Write nclc data in the colr atom of the video header. QuickTime only.
FFmpeg Info... / libraryInfo Button   Display information about the underlying library.