def write_video_clip_to_file(self, video_clip: VideoClip, output_path: Opt[str] = None, *,
audio: Union[str, bool] = True, verbose: bool = False, progress_bar: bool = True,
**kwargs):
"""
Writes a video clip to file in the specified directory
Parameters
----------
video_clip
output_path
audio
Audio for the video clip. Can be True to enable, False to disable, or an external audio file.
verbose
Whether output to stdout should include extra information during writing
progress_bar
Whether to output progress information to stdout
kwargs
List of other keyword arguments to pass to moviepy's write_videofile
"""
# Prepend crf to ffmpeg_params
ffmpeg_params = ['-crf', str(self.crf)] + self.ffmpeg_params
audio_bitrate = str(self.audio_bitrate) + 'k'
video_clip.write_videofile(output_path, audio=audio,
preset=self.preset, codec=self.codec, audio_codec=self.audio_codec,
audio_bitrate=audio_bitrate, ffmpeg_params=ffmpeg_params, **kwargs, verbose=verbose,
progress_bar=progress_bar)
return output_path
评论列表
文章目录