VideoEncoderSpec
What a video encoder writes: the format, the picture size and pixel format, the rate, and the colour, pixel shape and HDR metadata the output declares. MediaSink.addVideoEncoder opens an encoder from it, and Transcoder.transcode takes one as its video spec.
Constructors
Properties
The target bit rate in bits per second, for encoders that take one.
The colour the output declares: primaries, transfer, matrix, range and chroma location. Every field that is not unspecified is written, and the range when ColorInfo.fullRange or ColorInfo.rangeSpecified says so. A colour read from a stream or a frame fills its silences with guesses, so pass its ColorInfo.withoutGuesses to write only what the source declared. Null declares nothing, except that Transcoder then copies it from the source.
The encoder that writes codec. Null takes the one FFmpeg picks for the format, the first of FFmpeg.encodersFor. An encoder that writes another format is refused with FFmpegError.InvalidArgument.
The constant rate of the output. The encoder's time-base has one tick per frame at this rate, so it holds at most one frame per tick. Transcoder drops or repeats input frames to reach it, the way FFmpeg's fps filter does.
The HDR metadata the output carries, as stream side data and, for an encoder that reads it, in the bitstream too. Null writes none, except that Transcoder then copies it from the source. An empty HdrMetadata writes none in both cases.
Frames from one keyframe to the next. The default is two seconds of frames.
Encoder-specific options, passed through as av_opt_set strings: "preset" to "veryfast", "crf" to "23" (libx264), "allow_sw" to "1" (videotoolbox), etc. A key that sets the same thing as a field, such as b for bitrateBps, is refused with FFmpegError.InvalidArgument.
The pixel format the encoder writes.
The shape of one pixel, for anamorphic video. Null writes none, which players read as square, except that Transcoder then copies it from the source.