VideoMux

class lib.video.VideoMux(source_video: str, destination_video: str, codec: Literal['libx264', 'libx265'], codec_parameters: dict[str, str], mux_audio: bool = True)

Bases: object

A basic muxer for muxing converted faceswap frames to a video file using the original video as a reference

Parameters:
  • source_video (str) – The path to the source video to use as a reference for Audio and FPS

  • destination_video (str) – The full path to save the final video to

  • codec (T.Literal['libx264', 'libx265']) – The codec to use to encode the video

  • codec_parameters (dict[str, str]) – The options to use for the codec

  • mux_audio (bool) – True to mux order from the source video to the output

Methods Summary

encode(image)

Encode a frame to the video

Methods Documentation

encode(image: npt.NDArray[np.uint8] | None) None

Encode a frame to the video

Parameters:

image (npt.NDArray[np.uint8] | None) – The 3 channel BGR UINT8 image to encode to the video or None to finalize the video

Return type:

None

encode(image: npt.NDArray[np.uint8] | None) None

Encode a frame to the video

Parameters:

image (npt.NDArray[np.uint8] | None) – The 3 channel BGR UINT8 image to encode to the video or None to finalize the video

Return type:

None