MXVK Vulkan Framework 0.35.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
mxwrite-opencv.py File Reference

Capture OpenCV video through MXVK and encode it with MXWrite. More...

Go to the source code of this file.

Classes

class  mxwrite-opencv.CaptureWindow

Namespaces

namespace  mxwrite-opencv

Functions

 mxwrite-opencv.configure_encoder (args)
 mxwrite-opencv.fourcc_to_string (value)
 mxwrite-opencv.get_file_timestamp (capture, source_fps, frame_index)
 mxwrite-opencv.main ()
 mxwrite-opencv.open_camera_capture (index, width, height, fps)
 mxwrite-opencv.open_file_capture (filename)
 mxwrite-opencv.parse_arguments ()
 mxwrite-opencv.validate_arguments (args)

Detailed Description

Capture OpenCV video through MXVK and encode it with MXWrite.

Uses mxvk_ext.Capture for camera or file input, displays frames in an MXVK sprite, and writes file input as constant-frame-rate video. Camera capture retains monotonic timestamps. The example is intentionally split so MXVK owns capture/windowing and MXWrite owns encoding/muxing.

Running the example

python3 python-examples/opencv_mxwrite/mxwrite-opencv.py --input input.mp4 --output output.mp4
python3 python-examples/opencv_mxwrite/mxwrite-opencv.py --camera 0 --width 1280 --height 720

Requirements

Requires a CV-enabled mxvk_ext module, mxwrite_ext, OpenCV, and NumPy. The Linux camera path requests V4L2 MJPEG; other platforms use OpenCV's default camera backend.

Timing and controls

File input uses sequential PTS values at the input frame rate for CFR output. Camera input preserves monotonic capture timestamps. Escape or Ctrl-C stops capture; --frames limits the number of submitted frames.

Definition in file mxwrite-opencv.py.