Closed
Bug 1466408
Opened 7 years ago
Closed 5 years ago
Incorrect YUV -> RGB on full range video
Categories
(Core :: Audio/Video: Playback, defect, P3)
Tracking
()
RESOLVED
DUPLICATE
of bug 1459526
Tracking | Status | |
---|---|---|
firefox62 | --- | affected |
People
(Reporter: kasper93, Unassigned)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
Hi,
This is long standing bug, but given that streaming services are more and more popular and full range videos are more common we might want to support them properly. Especially that Chrome support it properly, forcing people to use it instead...
Basically what happens is that videos are always assumed to be 16-235 range resulting is incorrect range expansion on 0-255 videos. I am attaching two files full_range.mp4 and limited_range.mp4 they should render to be visually "similar", obviously one have less steps but that's not the point. On Firefox full_range video is expanded while it should not be, resulting in clipping in low and high area.
Back in the day I fixed similar issue in MPC-HC https://github.com/mpc-hc/mpc-hc/commit/7489c0d9934fea41456bf2456818425d80410f26 it is not quite nice workaround, but this is how it works and after this change conversion works as expected. I haven't looked and FF internals so this might be not related, but just throwing it here for reference.
Attached videos were created with following commands:
ffmpeg -f lavfi -i rgbtestsrc -pix_fmt yuvj420p -t 1 full_range.mp4
ffmpeg -f lavfi -i rgbtestsrc -pix_fmt yuv420p -t 1 limited_range.mp4
Regards,
Kacper
Reporter | ||
Comment 1•7 years ago
|
||
Comment 2•7 years ago
|
||
Jean-Yves does this fall into the HDR support bucket? Do we have a meta/tracking bug for HDR support already?
Rank: 25
Flags: needinfo?(jyavenard)
Priority: -- → P3
Comment 3•7 years ago
|
||
That's not HDR per say, just that our colour space handling is subpar. We have no code to distinguish full range from limited range.
In the bucket list I would add Colorspace improvements.
HDR task does have components in there.
Flags: needinfo?(jyavenard)
Updated•7 years ago
|
Blocks: wr-video-color
Comment 4•7 years ago
|
||
note that youtube streams HDR with both limited and full range
Comment 5•7 years ago
|
||
(In reply to Vittorio Giovara from comment #4)
> note that youtube streams HDR with both limited and full range
How do you choose between the two?
Comment 6•7 years ago
|
||
(In reply to Jean-Yves Avenard [:jya] from comment #5)
> (In reply to Vittorio Giovara from comment #4)
> > note that youtube streams HDR with both limited and full range
>
> How do you choose between the two?
you need to check the codec string, the last value represents the color range
for example `vp09.02.10.10.01.09.16.09.00` means it's either unknown or limited range, `vp09.02.10.10.01.09.16.09.01` means it is full range
the same concept (unfortunately) applies to av1 too
Comment 7•7 years ago
|
||
We typically never relied on the codec string to perform any actions. They typically are inaccurate or just plain wrong (like the web author just copy paste a codec string he found on the net, not bother to verify the actual profile and so on)
Comment 8•7 years ago
|
||
if you don't trust the codec string, then you need to parse the file header and determine range and other color properties yourself
Comment 9•6 years ago
|
||
note that neither bt601, 709 nor bt2020 defines what full range YUV means and how it should be converted to RGB.
So one could argue we're doing it right :)
Updated•6 years ago
|
Type: enhancement → defect
Comment 10•5 years ago
|
||
JPEG defines full-range BT.601.
Updated•5 years ago
|
Status: UNCONFIRMED → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•