Initially, I render the video in mp4 (x264) with the standard settings. Next I will convert it to Webm(vp8) using ffmpeg.
If I convert it with bt709 color space, then the video is displayed correctly everywhere, different browsers, different media players, but in Renpy the video gets color distortion.
Code: Select all
ffmpeg -i video.mp4 -c:v vp8 -crf 4 -b:v 30M -colorspace bt709 -color_primaries bt709 -color_trc bt709 -color_range pc -y video_709.webm
Code: Select all
METADATA: Video: vp8, yuv420p(pc, bt709, progressive), 2560x1440, SAR 1:1 DAR 16:9, 60 fps, 60 tbr, 1k tbn, 1k tbc (default)
If I convert it with the bt601 color space, then I need to additionally assign a filter -vf "colormatrix=bt709:smpte170m" so that the color matches the video with bt709. After conversion, the video will be displayed correctly in media players and renpy (without color distortion), but browsers will distort the color.
Code: Select all
ffmpeg -i video.mp4 -c:v vp8 -crf 4 -b:v 30M -colorspace smpte170m -color_primaries smpte170m -color_trc smpte170m -color_range pc -vf "colormatrix=bt709:smpte170m" -y video_601.webm
Code: Select all
METADATA: Video: vp8, yuv420p(pc, smpte170m, progressive), 2560x1440, SAR 1:1 DAR 16:9, 60 fps, 60 tbr, 1k tbn, 1k tbc (default)
Now I have to create two files in bt601 for renpy and bt709 for everything else.
I would like renpy to read the metadata and show the video in the color space that is specified in them. This will help to avoid distortion of colors.