Open akiirui opened 1 year ago
What exactly are you playing the file back in? Many video players don't properly handle full color range, and we don't recommend using it in nearly all cases.
What exactly are you playing the file back in? Many video players don't properly handle full color range, and we don't recommend using it in nearly all cases.
I‘m using mpv to play these files. There looks like no difference between "Limited" and "Full" for the AMD HW H.265/H264 encoder.
And the video files of AMD HW AV1 encoder are attached, see two videos.zip
What is your use case for full?
Most video editing applications and video streaming platforms expect a limited-range (partial) input; streaming or recording in Full range will result in color clipping, often reported as overly bright or dark image.
What is your use case for full?
Import to Davinci to edit, A larger color range helps me manipulate colors. Of course we have many way to bypass this issue, such as use AMD HW H265 to record full range video. (that is works fine with full) But here is a bug report for AMD HW AV1 encoder. Thanks.
Doesn't seem like a bug, though, and seems to work exactly as intended. Limited matches the original, while using Full alters the original.
Doesn't seem like a bug, though, and seems to work exactly as intended. Limited matches the original, while using Full alters the original.
But from AOM AV encoder or others encoder, it not same as AMD HW AV1 encoder:
mediainfo outputs of AOM-limited:
Video
ID : 1
Format : AV1
Format/Info : AOMedia Video 1
Format profile : Main@L4.1
Codec ID : V_AV1
Duration : 5 s 367 ms
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 60.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Default : No
Forced : No
Color range : Limited
Color primaries : BT.709
Transfer characteristics : sRGB/sYCC
Matrix coefficients : BT.709
mediainfo outputs of AOM-full:
Video
ID : 1
Format : AV1
Format/Info : AOMedia Video 1
Format profile : Main@L4.1
Codec ID : V_AV1
Duration : 5 s 384 ms
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 60.000 FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Default : No
Forced : No
Color range : Full
Color primaries : BT.709
Transfer characteristics : sRGB/sYCC
Matrix coefficients : BT.709
Screenshot of limited:
Screenshot of full:
@akiirui Could you do the same test with mp4, and upload both partial and full?
@akiirui Could you do the same test with mp4, and upload both partial and full?
Same as mkv. here are two videos, use AMD HW AV1 encoder and mp4. mp4.zip
Indeed it is the same, but it ruled out an important factor :)
The code is there to set full range, and seeing as the code is working for HEVC, I believe the path is valid.
case VIDEO_CS_SRGB:
enc->amf_color_profile =
enc->full_range
? AMF_VIDEO_CONVERTER_COLOR_PROFILE_FULL_709
....
set_av1_property(enc, OUTPUT_COLOR_PROFILE, enc->amf_color_profile);
Unfortuantely its not possible for me to confirm, seeing as I don't have an AMD av1 encoder avaliable to me.
As per AMD's documentation, that seems to be all that should be required, unlike HEVC, which requires:
set_hevc_property(enc, OUTPUT_COLOR_PROFILE, enc->amf_color_profile);
set_hevc_property(enc, NOMINAL_RANGE, enc->full_range);
There is no NOMINAL_RANGE
in the av1 headers, so even if want to set that, its not possible. Again, AMD docs seem to indicate that setting AV1_OUTPUT_COLOR_PROFILE -> COLOR_PROFILE_FULL_709 (which we do), should be sufficient.
Nonetheless, as far as I can see in the bitstream of the files you provided, the full range flag is not set (confirmed with a working aom-av1 file), so I think there is a possibility that this might be an AMF issue.
seq_header_obu\color_config(): color_range 0
In the working full range file from encoded with aom, this value is set to 1.
If you are able to confirm the issue with AMD's tools, like TranscodeHW, you could submit a bug report/issue on their github. Or perhaps reproducing with ffmpeg will suffice as validity (tested 2 implementations).
@flaeri Thanks.
In AMF_Video_Encode_AV1_API.md - Name: AMF_VIDEO_ENCODER_AV1_OUTPUT_COLOR_PROFILE
's Description, NOMINAL_RANGE
has been mentioned.
But in VideoEncoderAV1.h, It does not exist.
Maybe it's an AMF issue, I'll open an issue for it.
The 10-bit display while recording 8-bit content? From the log:
11:18:12.475: bits_per_color=10 11:18:12.475: space=RGB_FULL_G22_NONE_P709 11:18:12.475: sdr_white_nits=80
Without test tables(images) it is hard to say where the error is (display/encode/screenshot etc).
I have few test charts for 8-bit: https://obsproject.com/forum/resources/obs-studio-color-space-color-format-color-range-settings-guide-test-charts.442/ But you have 10-bit display.
What name: "amd-hw-av1_full.mkv" mean?
I'm not common with the AV1 encoder but it seems this media file has no range flag set at all, so almost any player will assume a partial range video here (while it can be full range and from what I see - I assume it is).
You can try make new shortcut to the mpv player and add in the end --vf=format:colorlevels=full
(this will ignore range flags and force full range on decoding). Run the shortcut and drag-n-drop the media file into the player, to see if the media can be displayed normally on your monitor (it is still 10-bit device, so it is unknown what you really see).
What name: "amd-hw-av1_full.mkv" mean?
Just color range "full".
You can try make new shortcut to the mpv player and add in the end --vf=format:colorlevels=full
Yep, that let this video displayed normally.
Such as @flaeri says, AMF av1 encoder doesn't set the full range flag. Maybe that's what's causing the problem.
Thanks.
This is a long standing issue with OBS not AMF, try recording with Game Bar or Radeon Software and you'll get full HDR in the video.
I reported this back in 2022 and was ignored, #7451
Operating System Info
Windows 11
Other OS
No response
OBS Studio Version
Other
OBS Studio Version (Other)
29.1.3
OBS Studio Log URL
https://obsproject.com/logs/lXfDZatEdQGpF247
OBS Studio Crash Log URL
No response
Expected Behavior
Use AMD HW AV1 encoder, when different color range "limited" and "full" the colors should be nearly identical when viewed with the naked eye.
Current Behavior
Use AMD HW AV1 encoder, when the different color ranges "limited" and "full", the color is different when viewed with the naked eye.
mediainfo outputs of range-limited.mkv:
mediainfo outputs of range-full.mkv:
Screenshot of range-limited.mkv:![range-limited mkv-00_00_03 400-0001](https://github.com/obsproject/obs-studio/assets/3736910/c676d714-b2a3-4f38-93ae-4f82592d1dbb)
Screenshot of range-full.mkv:![range-full mkv-00_00_00 533-0001](https://github.com/obsproject/obs-studio/assets/3736910/2ebbdb8b-332e-4f35-ba9f-b81fdafc4dd2)
The original background imange:![1141274](https://github.com/obsproject/obs-studio/assets/3736910/3f8788ea-27d4-4e29-8d2c-b9d516861dd6)
two videos.zip
Steps to Reproduce
AMD HW AV1
NV12
, "Color Space" tosRGB
and "Color Range" tolimited
.NV12
, "Color Space" tosRGB
and "Color Range" tofull
.Anything else we should know?
No response