Comments (18)
People can still upscale HD videos if they want to make them 4K or higher. But I think upscaling SD videos will be more common so I made that setting on by default.
from waifu2x-gui.
I'll consider this solved the SD Colorspace should cover most cases
from waifu2x-gui.
Since this is a ffmpeg issue you have to open up the bug with them and i'll update the ffmpeg version whenever they fix it. I can see that some bugs still haven't been fixed after 10 years, so it might take awhile...
https://trac.ffmpeg.org
Regardless this is very easy to fix, open the video in a video editor and bump up the saturation slightly then re-export. Since this isn't an issue with my code there is nothing for me to fix.
from waifu2x-gui.
Since this is a ffmpeg issue you have to open up the bug with them and i'll update the ffmpeg version whenever they fix it. I can see that some bugs still haven't been fixed after 10 years, so it might take awhile... https://trac.ffmpeg.org
Regardless this is very easy to fix, open the video in a video editor and bump up the saturation slightly then re-export. Since this isn't an issue with my code there is nothing for me to fix.
I am not sure, but maybe this can be solved with the command you use as well? Look here
from waifu2x-gui.
Ok, can you post the video that you posted (trim it if its long) if that answer is correct than adding this to the command should fix it.
-color_primaries bt2020 -color_trc bt709 -colorspace bt2020_ncl -color_range pc -bsf:v h264_metadata=video_full_range_flag=1:colour_primaries=9:transfer_characteristics=1:matrix_coefficients=9
I'm not sure if this will break videos that are not in the bt.2020 color space, so if this issue only occurs on certain videos I would instead advise you to run that command yourself in order to fix those vidoes.
from waifu2x-gui.
Ok, can you post the video that you posted (trim it if its long)
One.Piece.mp4
I am not sure if the answer is right or wrong but makes kinda sense. Because some colors are more saturated while others less. I would try it myself but I am pretty noob about how to use ffmpeg :/
from waifu2x-gui.
Ok, I tried adding those flags but it makes the colors TOO saturated.
I also tried -color_primaries 5 -colorspace 5 -color_trc 6
instead and while the colors aren't exactly the same they are a closer match, so I think I'll stick with this one.
from waifu2x-gui.
Well, that is definitely annoying. May I ask which code you use in the end (all the code) so I can ask in ffmpeg forums?
from waifu2x-gui.
The code is in a different repo, here:
https://github.com/Tenpi/waifu2x/blob/2cb76f0e2b296caedfbed5621a485a9f6bfef414/waifu2x.ts#L624
The full command should look something like ffmpeg -i frame%d.png -r 24 -vcodec libx264 -pix_fmt yuv420p -movflags +faststart -crf 16 -color_primaries 5 -colorspace 5 -color_trc 6 -vf crop=trunc(iw/2)*2:trunc(ih/2)*2 output.mp4
Good luck!
from waifu2x-gui.
@Tenpi I think I found the answer with some help ^^
https://old.reddit.com/r/ffmpeg/comments/whq5sm/color_losschange_with_ffmpeg/
Please read the post, he made some awesome explanations.
from waifu2x-gui.
Ok, you will need to edit the videos manually if they have wrong colors since there is no way for me to detect it automatically but I made the default color space bt709. I will leave this issue open if others experience the same problem.
from waifu2x-gui.
Ok, you will need to edit the videos manually if they have wrong colors since there is no way for me to detect it automatically but I made the default color space bt709. I will leave this issue open if others experience the same problem.
Well, weirdly enough it worked better for me (several videos) when I used NTSC DVD (-color_primaries smpte170m -colorspace smpte170m -color_trc smpte170m) instead of bt709. I just installed ffmpeg for the first time just for this haha :D
I am not %100 sure if you should change it again or not (its up to you), but I will ask one last thing about this. Can you add an option to remove upscaled images to recycle bin? So we can restore if colors are strange and do our own thing.
from waifu2x-gui.
I am not %100 sure if you should change it again or not (its up to you), but I will ask one last thing about this. Can you add an option to remove upscaled images to recycle bin? So we can restore if colors are strange and do our own thing.
You can fix this using the original video without any re-encoding, all it does is change the metadata:
ffmpeg -i input.mp4 -c copy -color_primaries smpte170m -colorspace smpte170m -color_trc smpte170m output.mp4
You seem to be upscaling old anime that is in SD which is why that color space works better for you. The bt709 is mostly used in HD videos. I added a checkbox in the settings to toggle between bt709 and smpte170m.
from waifu2x-gui.
I didn't know that, thanks ^^
Thanks for the toggle as well. Just a thought tho, isn't it expected to use SD videos since this is an upscaler :D
from waifu2x-gui.
Hopefully this will fix most color-related problems. Thanks for the effort, it was more complicated than I expected :)
from waifu2x-gui.
Well, sorry to reopen this but looks like there is a problem. When you don't select "SD Colorspace", output files don't have any audio.
from waifu2x-gui.
Please put separate bugs into separate issues, at this time I don't know why that could be happening
from waifu2x-gui.
Please put separate bugs into separate issues, at this time I don't know why that could be happening
I thought the issue is related to the recent "SD Colorspace" tick box you added. Mb
from waifu2x-gui.
Related Issues (14)
- Thank you for clean and easy to use GUI (and 2 issues :) HOT 8
- W2X shows its upscaling but it does not save the images - ergo - cannot create upscaled video HOT 6
- AppImage fails to launch HOT 3
- Failed to run AppImage HOT 4
- possible to add the real cugan pls in upscaler HOT 1
- can not pnpm run start+ HOT 1
- request models HOT 1
- [Suggestion] Little preview shows progress instead of looping the input video HOT 3
- Request for Linux adaptation. HOT 4
- Not working? HOT 1
- Real-ESRGAN webm conversion not working HOT 1
- Issue Installing (Can't open file for writing) HOT 2
- Webm doesn't complete conversion. HOT 9
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from waifu2x-gui.