Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Save Video Produces Inaccurate Colors #3053

Open
KiyoshiKuro opened this issue Nov 26, 2024 · 4 comments
Open

Save Video Produces Inaccurate Colors #3053

KiyoshiKuro opened this issue Nov 26, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@KiyoshiKuro
Copy link

  • Chainner version: 0.24.1
  • OS: Windows 11

Description

Colors in videos saved from Chainner are inaccurate, regardless of whether an upscale model is used or not. The issue persists across different formats and encoders. However, if I save the output as images instead of a video, the colors are correct.

I've tried a clean install of Chainner and extracting PNGs of the video frames before saving them as a video, but the colors remain incorrect. This happens with any video I've tested.

In previous versions of Chainner, when it used the Video Frame Iterator, I was able to upscale videos without color issues.

chaiNNer - R__Chainner Chains_Video chn •
video mkv - mpv
video2 mkv - mpv

In the example, the greens are darker, and the reds are desaturated.

Logs
main.log

@KiyoshiKuro KiyoshiKuro added the bug Something isn't working label Nov 26, 2024
@pokepress
Copy link

This is purely a hunch, but is is it possible it's an issue with FFMPEG, or the version being used by the software?

@KiyoshiKuro
Copy link
Author

Using my own ffmpeg with the command "ffmpeg -i input.mkv -c:v ffv1 output.mkv" produces a video with accurate colors. My own encode is also almost double the size of chainner's.
I tried replacing chainner's ffmpeg.exe and ffprobe.exe with the mine, and chainner still produces inaccurate colors.
I've attached mediainfo for mine and chainner's encodes.
chainnerffmpeg.txt
myffmpeg.txt

@NSQY
Copy link

NSQY commented Dec 2, 2024

This is caused by a color matrix mismatch when converting to or from RGB. It is often merely a metadata error.

@KiyoshiKuro
Copy link
Author

Thanks for your response. I'm not entirely sure what to do with that info. I tried editing the save video parameters to include "-colorspace bt709 -color_primaries bt709 -color_trc bt709" and it produced the same inaccurate colors as before, but the mediainfo does look closer to my own encode...
chainnerffmpeg2.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants