HardwareEncoder

data class HardwareEncoder(val codec: String, val device: String? = null)(source)

A hardware video encoder of FFmpeg, as found by findHardwareEncoder. codec is the name of the FFmpeg encoder, for example h264_nvenc or hevc_vaapi. device is the device the encoder encodes with, the DRM render node of VAAPI encoders, null for the other encoders.

Supported are the NVENC (_nvenc), VAAPI (_vaapi), Quick Sync (_qsv), AMF (_amf), Media Foundation (_mf) and VideoToolbox (_videotoolbox) encoders, the constructor throws an IllegalArgumentException for other encoders, see forCodec.

Since

openrndr 0.5.1

Constructors

Link copied to clipboard
constructor(codec: String, device: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Does the encoder encode full chroma (4:4:4)? Of the hardware encoders only NVENC does.

Functions

Link copied to clipboard
fun arguments(quality: Int?): List<String>

The arguments of the encoder for quality, a constant quality from 1 to 100 where higher is better, or null for the default bitrate of the encoder. A quality of 60 is comparable to the default constant rate factor of libx264. The arguments include the device of VAAPI encoders, keep Media Foundation from falling back to its software encoder, and let VideoToolbox fall back to its software encoder on Macs without a hardware encoder.

Link copied to clipboard
fun input(pixelFormat: String = "yuv420p"): EncoderInput

How frames in pixelFormat reach the encoder. pixelFormat is an FFmpeg pixel format: yuv420p for 8 bit 4:2:0, p010le for 10 bit 4:2:0, yuv444p for full chroma. VAAPI encoders take frames that are uploaded to the GPU by filters, Quick Sync, AMF and Media Foundation take 8 bit 4:2:0 frames as NV12.