News:

--

Main Menu

JPEG Imports incorrectly - Colour Discrepancy

Started by Cormy1, July 13, 2020, 09:03:00 PM

Previous topic - Next topic

Cormy1

Warning: Links contain loud obnoxious sounds, video feed/image is semi-lewd anime garbage.

Source image: https://pbs.twimg.com/media/DnzVCAFXcAAhEv2.jpg
What Avidemux produces:
https://2eu.funnyjunk.com/comments/Okay+i+fix+there+is+no+1080p+version+of+_7a8ee1420b5abed6b149d8d4daac75fa.mp4

Even in the avidemux project I can see that the colour is wrong, like it was incorrectly imported from the beginning.

eumagga0x2a

Limited vs full color (actually, luma) range (in Avidemux "Contrast" video filter jargon "MPEG" vs "PC").

Cormy1

What's the issue though?
I've heard of Limited colour palettes being "stretched" to full range in order to comply with PC, but why does it do it?
It's just a JPEG, so it's the same kind of data found in video streams, so this should be able to happen to video aswell no?
And then if you're in copy mode, you can't correct this since it's only in a filter.
The fact that it happens during the decoding step should mean that you can change the way it is decoded/imported before encoding, before using filters. You shouldn't need a filter for this.

Also the MPEG2 -> PC button makes this worse, so I guess I need the inverse of this button...? It was converted to PC during import/decode, now I need to go back in the other direction to Limited.
How can I do this?

eumagga0x2a

#3
There is a whole knot of problems arising from different handling of range / contrast / gamma by different decoders, displayed by different video drivers in a non-uniform way. If contrast was increased so that some color values got clipped, no satisfactory way back by reducing contrast is possible.

There should be ways to tell libavcodec whether to stretch the range or not when decoding JPEG. I'll try to investigate in not very near future.

QuoteIt's just a JPEG, so it's the same kind of data found in video streams, so this should be able to happen to video aswell no?

Yes, and as if it were not enough, different video output drivers behave differently on this topic.

Cormy1

Were you able to resolve this or look into it further?

eumagga0x2a

#5
I assume that topic was addressed by a number of commits in early autumn of 2020. You don't test nightlies, do you? Actually, you do. Are there still issues with color range not covered?

Cormy1