media::encoder

The video codecs that this platform can encode, found by a live test and cached.

Group mediacore

Detailed description

The codec catalogue is the list of video codecs that the project supports. The codec probe opens a recorder for each codec and container in the catalogue and pushes frames into it, because the codec list that Qt reports includes encoders that fail at run time. One tier of the probe runs the same test in a child process. The results are cached for each host. copyImageToFrame() copies an image into a video frame row by row.

Function documentation

copyImageToFrame

bool encoder::copyImageToFrame(const QImage &image, QVideoFrame &frame, QString *error = nullptr)

Copy image into frame one row at a time, honoring both row lengths.

A `QImage` row and a `QVideoFrame` row need not have the same length. Qt pads a video frame's row to a multiple of 16 bytes (`qvideotexturehelper_p.h`: `(width * 4 + 15) & ~15` for RGBA8888), while an RGBA8888 image row is `width * 4` bytes. A copy of the whole image as one block therefore starts each row a little earlier than the last, and the error grows down the frame: every scan line skews to the right and wraps into the next one (construct-field-defects D3, the owner's Windows export of 2026-10-08). This copies `width * 4` bytes per row, from `image.bytesPerLine()` steps in the source to `frame.bytesPerLine(0)` steps in the frame.

It refuses, with a reason in error, rather than clamping: a frame that is not mapped for writing, a size or pixel format that differs from the image, or a mapped plane too small for the rows. A silent clamp is how the old copy left the last rows of every frame unwritten.

image is the source, in `QImage::Format_RGBA8888`. frame is the destination, mapped for writing, in `QVideoFrameFormat::Format_RGBA8888`, the same size as image. error, when not null, receives the reason on failure.

Returns true when every row was copied, and false otherwise.

openTimeoutMsFor

int encoder::openTimeoutMsFor(QMediaFormat::VideoCodec codec)

How long the recorder may take to reach RecordingState for codec.

On Windows the FFmpeg of the Qt kit has one H.264 and one HEVC encoder: `h264_mf` and `hevc_mf`, Media Foundation transforms (Qt 6.10.1 `avcodec-61.dll` holds neither libx264 nor openh264, searched on mathilde64 2026-10-08). The owner's H.264 export in MP4 was refused on Windows while MPEG-4 Part 2, a software encoder in the same DLL, passed (construct-field-defects D2). A transform that activates a GPU encoder was never timed here, so it gets 3 s and the probe logs the time it took. The other encoders keep 350 ms, which holds the full sweep near its budget. Until CFD-W28 the logged time was the cap itself, for every codec (§CFD-F-2a): the probe waited out its whole cap.

Returns the open timeout in milliseconds.

In this section