REAL-Video-Enhancer icon indicating copy to clipboard operation
REAL-Video-Enhancer copied to clipboard

Color shifts in video exports

Open painterize opened this issue 1 year ago • 6 comments

Your project is fantastic, however the color of the ProRes export does not exactly match the color of the source.

I'm using a MacBook Pro 2019.

In my tests, it's mainly shades of blue which seem to noticeably shift in the export.

Can the next version please have this fixed? In comparison, the Windows version of the "Hybrid" application by Selur can process RealSR and create exports which exactly match the source video color.

painterize avatar Aug 23 '24 16:08 painterize

Some models can have color shifting, does it happen with any other encoder?

TNTwise avatar Aug 23 '24 16:08 TNTwise

I tested the same RealSR JPEG model in your app and in the Hybrid (Windows) app.

If the encoder in your app is always ffmpeg, then maybe the command line needs extra parameters which carry over the exact colour metadata of the source?

Hybrid uses Vapoursynth scripts which seem to include lines which maintain color properties (I don't fully understand this stuff unfortunately).

painterize avatar Aug 23 '24 16:08 painterize

Does rife have color shifting?

Here is what I've done yt-dlp this video https://www.youtube.com/watch?v=pSsUhlXdMmQ

Run REAL-Video_enhancer interpolate on it with pytorch, rife 2.22-lite

Opening both the downloaded video and the interpolated video; pausing them both on the first frame. When alt tabbing between them both, I can see a noticeable color shift.

I don't know if this is a rife thing, or a RVE(real-video-enhancer) thing.

Late to this discussion but I think the problem might be that ffmpeg by default converts RGB to YUV using bt601, regardless of the resolution (at least according to this article I found).

I noticed some videos I was interpolating had noticeable color shifting, so I tested this by adding -colorspace bt709 to the ffmpeg write command of FFmpeg.py in the backend here, and it fixed the color shift issue I was having

This is kinda just a bandaid for bt709 YUV videos, to fix the problem entirely you'd prob need to ffprobe to find the colorspace of the video first then encode the output video to that same colorspace (or use a library to find the colorspace, tho idk any)

charliecao02 avatar Nov 18 '24 10:11 charliecao02

Late to this discussion but I think the problem might be that ffmpeg by default converts RGB to YUV using bt601, regardless of the resolution (at least according to this article I found).

I noticed some videos I was interpolating had noticeable color shifting, so I tested this by adding -colorspace bt709 to the ffmpeg write command of FFmpeg.py in the backend here, and it fixed the color shift issue I was having

This is kinda just a bandaid for bt709 YUV videos, to fix the problem entirely you'd prob need to ffprobe to find the colorspace of the video first then encode the output video to that same colorspace (or use a library to find the colorspace, tho idk any)

Could this amendment be made to the current working MacOS version please?

painterize avatar Dec 31 '24 04:12 painterize

I won't make changes to the outdated build, sorry.

TNTwise avatar Dec 31 '24 04:12 TNTwise

Finally got around to fixing this

TNTwise avatar Jun 06 '25 04:06 TNTwise