movis.util.add_materials_to_video#

movis.util.add_materials_to_video(video_file: str | PathLike, audio_file: str | PathLike, dst_file: str | PathLike, subtitle_file: str | PathLike | None = None) None[source]#

Merges a video file, an audio file, and optionally a subtitle file into a new video file.

It uses the ffmpeg library for media processing. The resulting video will have the audio and optionally the subtitles embedded.

Args:
video_file:

A str or PathLike object representing the path to the source video file.

audio_file:

A str or PathLike object representing the path to the audio file to be added.

dst_file:

A str or PathLike object representing the path to the destination video file.

subtitle_file:

A str, PathLike, or None representing the path to the subtitle file to be added. Default is None.