Shortcuts

mmcv.video.convert_video

mmcv.video.convert_video(in_file: str, out_file: str, print_cmd: bool = False, pre_options: str = '', **kwargs)None[source]

Convert a video with ffmpeg.

This provides a general api to ffmpeg, the executed command is:

`ffmpeg -y <pre_options> -i <in_file> <options> <out_file>`

Options(kwargs) are mapped to ffmpeg commands with the following rules:

  • key=val: “-key val”

  • key=True: “-key”

  • key=False: “”

Parameters
  • in_file (str) – Input video filename.

  • out_file (str) – Output video filename.

  • pre_options (str) – Options appears before “-i <in_file>”.

  • print_cmd (bool) – Whether to print the final ffmpeg command.