diplomat.utils.video_splitter.split_videos
- diplomat.utils.video_splitter.split_videos(videos: Union[Path, List[Path]], seconds_per_segment: Union[List[int], int] = 300, output_fourcc_string: Optional[str] = None, output_extension: Optional[str] = None) List[List[Path]][source]
Split a video into even length segments. This will produce a list of videos with “-part{number}” appended to the original video name in the same directory as the original video.
- Parameters:
videos – Either a single path-like object (string or Path) or a list of path-like objects, being the paths to the videos to split into several segments.
seconds_per_segment – An integer or a list of integers. If a single integer, represents the length of each split segment in seconds (Ex. if 30, split the clip every 30 seconds). If a list of integers, represents the locations to split the video at in seconds. The list can be out of order, as it will be automatically sorted. Also, values that are out of range will be ignored. (Ex. if [10, 400, 100, 30], split the video at 10s, 400s, 100s, and 30s].
output_fourcc_string – Optional, the fourcc string to use for output videos. If not specified uses input video fourcc code.
output_extension – Optional, the file extension to use for output videos (including the dot). Defaults to the input file extension if not specified.
- Returns:
A list of lists of Path objects, being the new split video paths for each and every video…