Skip to main content

ClikaRT::io::VideoWriter

class

Header: ClikaRT/io/video.h

Encode a stream of channels-last RGB [H, W, 3] UInt8 frames to a video file. Move-only. Every fallible method raises ClikaRT::Error on failure.

Static member functions

open()

static VideoWriter open(
    std::string_view path,
    std::string_view codec,
    double fps,
    int width,
    int height
)

Open a writer to path producing codec at fps and width×height. An empty codec picks the first encoder the discovered set offers along a fixed preference list (h264, hevc, vp9, mpeg4) and logs the pick; a named codec is kept as given and fails when its encoder is absent, naming the encoders found. path / codec are copied.

Declared in ClikaRT/io/video.h, line 154

Member functions

VideoWriter()

VideoWriter(VideoWriter&&) noexcept

Declared in ClikaRT/io/video.h, line 159

operator=()

VideoWriter& operator=(VideoWriter&&) noexcept

Move-assign: transfers the writer.

Declared in ClikaRT/io/video.h, line 161

~VideoWriter()

~VideoWriter()

Finalizes the container if still open, then releases the writer.

Declared in ClikaRT/io/video.h, line 163

write_frame()

void write_frame(const Tensor& frame)

Append one [H, W, 3] UInt8 frame (geometry must match the writer's).

Declared in ClikaRT/io/video.h, line 167

close()

void close()

Finalize the file (also runs implicitly on destruction if not called).

Declared in ClikaRT/io/video.h, line 171