nicetoolbox.utils.video.frames_to_video

nicetoolbox.utils.video.frames_to_video(input_folder: str | None, out_filename: str, fps: float = 30.0, start_frame: int = 0, audio_path: str | None = None, srt_path: str | None = None, frame_limit: int | None = None) int[source]

Convert a folder of frames to a video using ffmpeg.

Parameters:
  • input_folder (Optional[str]) – Path to the folder containing the frames. If None, a black fallback video is generated.

  • out_filename (str) – Path to the output video file.

  • fps (float, optional) – Frames per second of the output video. Defaults to 30.0.

  • start_frame (int, optional) – The starting frame number. Defaults to 0.

  • audio_path (Optional[str], optional) – Path to an audio file to include. Defaults to None.

  • srt_path (Optional[str], optional) – Path to a subtitle (SRT) file to include. Defaults to None.

  • frame_limit (int, optional) – Limit on how many frames to compose. Defaults to None.

Returns:

Return code of the ffmpeg command.

Return type:

int