Package-level declarations

Types

Link copied to clipboard
data class EncoderInput(val pixelFormat: String?, val filters: List<String>)

How frames reach an encoder: the pixel format they are converted to, or null when filters convert them, and filters to append to the filter chain

Link copied to clipboard
class FrameEvent(val frame: ColorBuffer, val timeStamp: Double)
Link copied to clipboard
Link copied to clipboard
data class HardwareEncoder(val codec: String, val device: String? = null)

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.

Link copied to clipboard

Transfer functions that HDR video is encoded with

Link copied to clipboard
@Serializable
data class MetadataContainer(val streams: List<MetadataStream>, val format: MetadataFormat) : Record
Link copied to clipboard
@Serializable
data class MetadataFormat(val filename: String? = null, val size: Int? = null, val start_time: Double? = null, val duration: Double? = null, val bit_rate: Int? = null, val nb_streams: Int? = null) : Record
Link copied to clipboard

A class to retrieve metadata, typically from video files, but compatible with any media accepted by ffprobe.

Link copied to clipboard
@Serializable
data class MetadataStream(val width: Int? = null, val height: Int? = null, val codec_type: String? = null, val codec_name: String? = null, val pix_fmt: String? = null, val bit_rate: Int? = null, val nb_frames: Int? = null, val sample_rate: Int? = null, val channels: Int? = null) : Record
Link copied to clipboard
Link copied to clipboard

ScreenRecorder extension can be used to record to contents of a Program to a video

Link copied to clipboard
enum State : Enum<State>
Link copied to clipboard
data class VideoDetails(val width: Int, val height: Int, val framerate: Double, val duration: Double) : Record
Link copied to clipboard
data class VideoDeviceMode(val width: Int, val height: Int, val minFrameRate: Double? = null, val maxFrameRate: Double? = null, val pixelFormat: String? = null, val codec: String? = null)

A mode a video device supports. What is known depends on the platform: AVFoundation (macOS) and dshow (Windows) report frame rates, v4l2 (Linux) reports sizes and formats only.

Link copied to clipboard

The dynamic range of the frames in VideoPlayerFFMPEG.colorBuffer

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

Video player based on FFMPEG

Link copied to clipboard

Rotations of the frames of a video, for example to store a portrait video in landscape for a screen that is mounted on its side

Link copied to clipboard
Link copied to clipboard
class VideoWriter(val useVariableFrameRate: Boolean = false)
Link copied to clipboard
abstract class VideoWriterProfile

Properties

Link copied to clipboard

Functions

Link copied to clipboard

The ffmpeg executable that VideoWriter runs: the executable VideoWriter.findFfmpeg finds, or the built-in ffmpeg when it finds none

Link copied to clipboard
fun findHardwareEncoder(codecName: String, pixelFormat: String = "yuv420p", ffmpeg: String = ffmpegExecutable()): HardwareEncoder?

Finds a hardware encoder for codecName that ffmpeg can encode frames in pixelFormat with on this system. codecName is the FFmpeg name of the codec, for example h264, hevc or av1, pixelFormat is the pixel format the frames are encoded in, see HardwareEncoder.input.

Link copied to clipboard
fun ScreenRecorder.h264(configure: H264Profile.() -> Unit)
Link copied to clipboard
fun Program.loadVideo(fileOrUrl: String, audioDevice: AudioDevice? = AudioSystem.defaultDevice, mode: PlayMode = if (audioDevice == null) PlayMode.VIDEO else PlayMode.BOTH, configuration: VideoPlayerConfiguration = VideoPlayerConfiguration()): VideoPlayerFFMPEG

Load a video

Link copied to clipboard
fun loadVideoDevice(audioDevice: AudioDevice? = null, deviceName: String = VideoPlayerFFMPEG.defaultDevice(), deviceMode: VideoDeviceMode, mode: PlayMode = PlayMode.VIDEO, configuration: VideoPlayerConfiguration = VideoPlayerConfiguration.live()): VideoPlayerFFMPEG

Load a video device in deviceMode, a mode from VideoPlayerFFMPEG.listDeviceModes

fun loadVideoDevice(audioDevice: AudioDevice? = null, deviceName: String = VideoPlayerFFMPEG.defaultDevice(), mode: PlayMode = PlayMode.VIDEO, width: Int? = null, height: Int? = null, frameRate: Double? = null, configuration: VideoPlayerConfiguration = VideoPlayerConfiguration.live(), pixelFormat: String? = null, codec: String? = null): VideoPlayerFFMPEG
Link copied to clipboard
fun probeVideo(videoFile: File): VideoDetails?

Probes a video file to extract its details such as width, height, framerate, and duration.

fun probeVideo(filename: String): VideoDetails?

Probes a video file by its filename to extract details such as width, height, framerate, and duration.