Skip to content
theRealProHacker edited this page Mar 13, 2023 · 5 revisions

How to set an FFmpeg codec for a specific file extension

Sometimes you might want to add or update the FFmpeg codec for a file extension on a specific device or for a specific use case. To do this, use add_codec.

from pygame_screen_record.ScreenRecorder import add_codec

# Use mp4v instead of h264 for .mp4 files
add_codec("mp4", "mp4v")

For more information on why h264 is the default instead of mp4v, see #3.

Clone this wiki locally