Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed HDR handling to use svtav1-params and accompanying values and syntax. #3

Merged
merged 4 commits into from
Dec 7, 2024

Conversation

Cryator
Copy link
Contributor

@Cryator Cryator commented Dec 6, 2024

Context

Current handling of HDR encoding appears to be broken. This is due to the libsvtav1-params command not being recognized by the libsvtav1 encoder in FFmpeg. Reading GitLab documentation suggests using svtav1-params. Documentation: https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/master/Docs/Parameters.md

Choices

The first change is a find and replace within the run_ffmpeg function. This updates the options in in encode_settings to use svtav1-params and its associated values as replacements for the old libsvtav1-params and its associated values.

get_hdr_settings has also been updated as svtav1-params does not accept the standard ffprobe output in color_spaces but instead requires tweaked values. A dictionary has been added and if a match from the dictionary is found in the color_space variable input it is mapped to an appropriate value; otherwise the dictionary should be ignored.

Test instructions

  1. Using HDR content previously encoded with perform encode.
  2. Run ffproble check (ffprobe -hide_banner -loglevel warning -select_streams v -print_format json -show_frames -read_intervals "%+Bump DavidAnson/markdownlint-cli2-action from 15 to 18 #1" -show_entries "frame=color_space,color_primaries,color_transfer,side_data_list,pix_fmt" -i [File.mkv]) against original file, newly encoded file, and previously encoded file.
  3. Verify outputs to ensure that all files match indicating an identical encode.

Note: Some mastering display settings may not be identical as input values are typically simplified rather than having the same input values as pulled from ffprobe. In this case calculated values should still match (e.g. "red_x": "34000/50000" = 0.68 = "red_x": "34000/50000").

Checklist before requesting a review

  • I have performed a self-review of my code
  • I've added documentation about this change to the README.
  • I've not introduced breaking changes.

Copy link
Owner

@Dashboy1998 Dashboy1998 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good just need some changes to confirm to coding standards

Cryator and others added 2 commits December 6, 2024 15:01
@Cryator Cryator requested a review from Dashboy1998 December 6, 2024 20:03
@Dashboy1998 Dashboy1998 merged commit 0cc281f into Dashboy1998:main Dec 7, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants