When you are using python moviepy to write video files, you should know what codecs supported by ffmpeg. These codecs is also supported by python moviepy. In this tutorial, we will give you a full list.
Preliminary
We often use VideoClip.write_videofile() to write a video file. This function is defined as:
def write_videofile(self, filename, fps=None, codec=None, bitrate=None, audio=True, audio_fps=44100, preset="medium", audio_nbytes=4, audio_codec=None, audio_bitrate=None, audio_bufsize=2000, temp_audiofile=None, rewrite_audio=True, remove_temp=True, write_logfile=False, verbose=True, threads=None, ffmpeg_params=None, logger='bar'):
As to some video type, for example, avi video. You should set a codec parameter. What is this value?
This codec will be passed into ffmpeg. We can use codecs supported by ffmpeg.
A full list of codecs supported by ffmpeg
If you have installed ffmpeg in your computer. You can use command below to list all codecs supported by ffmpeg.
ffmpeg -codecs
Here is an example:
Moreover, you also can find these codecs here.
https://ffmpeg.org/ffmpeg-codecs.html