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

LibPlacebo Tonemapping issues #629

Closed
Dendraspis opened this issue Oct 14, 2024 · 3 comments
Closed

LibPlacebo Tonemapping issues #629

Dendraspis opened this issue Oct 14, 2024 · 3 comments

Comments

@Dendraspis
Copy link
Contributor

Hello rigaya,

while implementing the new parameter I have some little issues and I hope it's okay to make just this one issue for all of those:

  1. The Options List mentions src_csp=<string> and dst_csp=<string> whereas the CLI help says src_csp=<int> and dst_csp=<int>. In case both are accepted, maybe something like src_csp=<string/int> would be useful, but it would be great if both could give the same information. 😅

  2. The param metadata is defined as:
    metadata=<int>
    Data source to use for tone mapping.
    But there is also a list with defined values given: any, none, hdr10, hdr10plus, cie_y
    So I assume it should be metadata=<string> instead? Code-wise it should be the same as the other options, but difficult when using Code Preview on GitHub.

  3. While testing (2) I tried --vpp-libplacebo-tonemapping metadata=hdr10plus as well as --vpp-libplacebo-tonemapping metadata=3, but I always get:

Error: Unknown param "metadata" for option "--vpp-libplacebo-tonemapping"
Did you mean param(s) below?
  dst_max

Using for example --vpp-libplacebo-tonemapping src_csp=hdr10,dst_csp=sdr works without issues.

  1. The Options List doesn't mention it, but the CLI help mentions also:
lut_type=<string>         LUT interpretation method
                            (default:(null))
                            native, normalized, conversion

Beside the fact that it is missing: Is it only used with the LUT file or is this parameter used independently?

  1. The CLI help loos like this and it would be awesome to fix the "NewLine-issues":
 --vpp-libplacebo-tonemapping [<param1>=<value>][,<param2>=<value>][...]
     Converts colorspace of the video.
    params
      src_csp=<int>            input colorspace (default: hdr10)
      dst_csp=<int>            output colorspace (default: sdr)
                                auto, sdr, hdr10, hlg, dovi, rgb
      src_max=<float>          input max (nits) (default: 0(HDR)/0(SDR))
      src_min=<float>          input min (nits) (default: 0.0050(HDR)/0.2023(SDR))
      dst_max=<float>          output max (nits) (default: 0(HDR)/0(SDR))
      dst_min=<float>          output min (nits) (default: 0.0050(HDR)/0.2023(SDR))
      dynamic_peak_detection=<bool>  Enable dynamic peak detection (default:true)
      smooth_period=<float>          Smoothing coefficient for detected values (default:20.0)
      scene_threshold_low=<float>    Lower threshold for scene change detection (dB) (default:1.0)
      scene_threshold_high=<float>   Upper threshold for scene change detection (dB) (default:3.0)
      percentile=<float>             Percentile to consider for luminance histogram (default:99.995)
      black_cutoff=<float>           Black level cutoff intensity (PQ) (default:1.0)
      gamut_mapping=<string>          Gamut mapping mode
                                (default:perceptual)
                                clip, perceptual, softclip, relative
                                saturation, absolute, desaturate, darken
                                highlight, linear      tonemapping_function=<string>   Tone mapping function
                                (default:bt2390)
                                clip, st2094_40, st2094_10, bt2390, bt2446a
                                spline, reinhard, mobius, hable, gamma
                                linear, linearlight      tone_constants=<string>  Tone mapping constants (e.g. "exposure=0.25")
      metadata=<int>           Metadata source to use
                                (default:any)
                                any, none, hdr10, hdr10plus, cie_y      contrast_recovery=<float> Contrast recovery strength (default:0.3)
      contrast_smoothness=<float> Contrast recovery lowpass kernel size (default:3.5)
      visualize_lut=<bool>     Visualize tone mapping curve (default:false)
      show_clipping=<bool>     Highlight clipped pixels (default:false)
      use_dovi=<bool>          Use Dolby Vision RPU (default:auto)
      lut_type=<string>         LUT interpretation method
                                (default:(null))
                                native, normalized, conversion      dst_pl_transfer=<string>     Output transfer function (must be used with dst_colorprim)
                                (default:unknown)
                                unknown, srgb, bt1886, linear, gamma18
                                gamma20, gamma22, gamma24, gamma26, gamma28
                                prophoto, st428, pq, hlg, vlog, slog1, slog2      dst_pl_colorprim=<string>    Output primaries (must be used with dst_transfer)
                                (default:unknown)
                                unknown, bt601_525, bt601_625, bt709, bt470m
                                ebu_3213, bt2020, apple, adobe, prophoto
                                cie_1931, dci_p3, display_p3, v_gamut
                                s_gamut, film_c, aces_ap0, aces_ap1      knee_adaptation=<float>    Knee adaptation speed (default:0.40)
      knee_min=<float>           Minimum knee point (default:0.10)
      knee_max=<float>           Maximum knee point (default:0.80)
      knee_default=<float>       Default knee point (default:0.40)
      knee_offset=<float>        Knee offset (default:1.00)
      slope_tuning=<float>       Slope tuning (default:1.50)
      slope_offset=<float>       Slope offset (default:0.20)
      spline_contrast=<float>    Spline contrast (default:0.50)
      reinhard_contrast=<float>  Reinhard contrast (default:0.50)
      linear_knee=<float>        Linear knee point (default:0.30)
      exposure=<float>           Exposure adjustment (default:1.00)
@rigaya
Copy link
Owner

rigaya commented Oct 16, 2024

Thank you for the report about --vpp-libplacebo-tonemapping.

  1. The web help is correct and should be src_csp=<string> and dst_csp=<string>.

2 & 3. It seems like parser for metadata is not working properly, and it shall be metadata=<string>.

  1. lut_type is intended to be used with --vpp-libplacebo-tonemapping-lut.

  2. I'll have it fixed in next release.

@Dendraspis
Copy link
Contributor Author

Thanks for the fixes. 🙂

With the latest release this issue seems to be solved, so I close it.

Little side note:
The Changelog of v7.71 doesn't mention the fixed --vpp-libplacebo-tonemapping metadata parameter, but the referenced d2be979 commit has fixed it - at least my test encode succeeded. 😅

@rigaya
Copy link
Owner

rigaya commented Oct 26, 2024

Thank you for confirming!

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

No branches or pull requests

2 participants