-
-
Notifications
You must be signed in to change notification settings - Fork 142
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
avfilter: add vf_tonemap_videotoolbox #369
avfilter: add vf_tonemap_videotoolbox #369
Conversation
This filter does HDR(HDR10/HLG/Dolby Vision) to SDR conversion with tone-mapping using Metal. For example: ffmpeg \ -init_hw_device videotoolbox \ -i INPUT \ -vf hwupload,tonemap_videotoolbox=t=bt2020:tonemap=linear:format=p010 \ -c:v h264_videotoolbox \ -b:v 2000k \ -c:a copy \ -y OUTPUT Signed-off-by: gnattu <gnattuoc@me.com>
A lot of the context used in this file is missing in the upstream. Is it possible to have this upstreamed? |
The existence of vf_libplacebo makes it more difficult to upstream new GPGPU-based tonemap filters. They may require your filter to behave like libplacebo, even though ours is a stripped-down version. In addition, new DoVi-related structures and funcs need to be discussed and defined in colorspace.h. Finally, there are very few developers in upstream who can review Metal/Obj-C code, and such huge filters may be ignored for months or even forever. . . |
Here are some clips I collected for testing DoVi/HDR. You can play it to see if the color is normal and whether it will cause ffmpeg to fail. |
These are all P010 videos, and I've already tested a lot of them. I'm leaving non P010 and NV12 formats off until we have samples that confirmed to work. |
What I mean is that it contains clips that need to reset the filter. As for non-(4:2:0 10-bit) DoVi, I think it won't happen any time soon. |
I tested all of them and every sample looks good.
Then keep p010 and nv12 as only supported formats for now. One interesting thing is, during my testing I found an ffmpeg issue on |
These are generic lavc options. Encoders should adapt to these options and throw an error if the user settings exceed the hardware specs, or automatically roll back to the default values. |
It's not about "exceeding hardware specs"; it's a supported value, but it just works buggy. The encoder would succeed, albeit with a much slower speed (up to a 50% regression), and in some circumstances, the ffmpeg process just hangs and doesn't proceed. This happens randomly. Removing the |
CI failure due to remote issue |
Ideally this undefined behavior should not occur. Either work or fail. If removing them does not cause rate control regression, then there is no problem.
|
VT obeys the My suggested changes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yolo
This filter does HDR(HDR10/HLG/Dolby Vision) to SDR conversion with tone-mapping using Metal.
For example:
Changes
Issues
Fixes #357