Selur's Little Message Board

Full Version: FFmpeg 'color adjustment' messes up 4:2:2 colors
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Enabling FFmpeg 'color adjustment' messes up the colors when encoding 4:2:2 video to x264 with color space 'i442'. To reproduce using 2021.04.12.1 :
  • input 4:2:2 video
  • enable FFmpeg 'color adjustment' (no need to adjust parameters)
  • x264
    • color space: i422 => wrong colors
    • color space: i420 => right colors
Interestingly the filter preview works fine and shows the effect of adjusted color parameters. Attached is a frame from the original 4:2:2 video and the corresponding frame in the encoded x264 in i422 (no other filtering is applied, only cropping + letterbox).
Thanks for reporting the problem.
Will look at it this evening after work. (wild guess atm. is that ffmpeg isn't used but mencoder and the U and V channels get mixed up)

Since you didn't read the sticky and didn't share the version or OS you are using, I assume you are not interested in getting a fixed dev version once I fixed the issue.


Cu Selur
Just to mention :

I have similar visual issue like above,but not so heavy.
Input is a dvd movie ,output is x265 mkv.
Due to lack of free time,no further info is available....
(08.07.2021, 05:13)Selur Wrote: [ -> ]Thanks for reporting the problem.
Will look at it this evening after work. (wild guess atm. is that ffmpeg isn't used but mencoder and the U and V channels get mixed up)

Since you didn't read the sticky and didn't share the version or OS you are using, I assume you are not interested in getting a fixed dev version once I fixed the issue.


Cu Selur

Thanks for the quick reply. Sorry I did read the sticky, but assumed debug logs were only necessary when export failed or program crashed. I'm on Win10.
I wanted to attach a short video sample, but mp4 and avi files apparently can't be attached here?

Karel
Quote:I wanted to attach a short video sample, but mp4 and avi files apparently can't be attached here?
correct

---
I can reproduce the issue.
Happens since the color adjustment is implemented through mencoder (not ffmpeg), no clue how to fix it atm. but I'll look into it.

Cu Selur
Will add an ugly workaround by adding 'swapuv' when this is used.
As a side note: using FFmpeg/MPlayer/Mencoder based filters instead of Avisynth and Vapoursynth is a bad idea, so it is not recommended.

Cu Selur
Send you a link to a dev version for testing via pm.

Cu Selur
Thanks for the dev version fix!
Can I ask why correcting basic brightness/contrast with FFmpeg/Mencoder is not recommended? Is it really bad, or is it just not as good as Avisynth/Vapoursynth?
I use it because it so much faster than the latter: generating the preview files from lossless FFV1 videos (from an external harddrive) takes a lot of time, while FFmpeg filtering has instant preview.

Karel
Quote:Can I ask why correcting basic brightness/contrast with FFmpeg/Mencoder is not recommended? Is it really bad, or is it just not as good as Avisynth/Vapoursynth?
Simply not as versatile and good as Vapoursynth/Avisynth.

Quote:I use it because it so much faster than the latter: generating the preview files from lossless FFV1 videos (from an external harddrive) takes a lot of time, while FFmpeg filtering has instant preview.
That depends on the source filter that is used.
FFVideoSource will create an index on the hdd which is slower than, LWLibavSource which creates the index in memory.
Indexing is important for most filters since it allow accurate access to frames.
Also note that Hybrid only creates the index during the time opening the file, later it will reuse the index.

Cu Selur
**update: with the 'swapuv' fix in release 2021.07.18.1 (also in the dev version you pm'd me) the video exports OK, but the filter preview has the UV components reversed now! Before the fix it was the other way around...
Pages: 1 2