-
Notifications
You must be signed in to change notification settings - Fork 12
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
non-trivial color formats support in FFmpeg >= 4.1 #26
Comments
Solving it in generic way is non-trivial. There are codecs and hardware that support 4:2:0, 4:2:2 and 4:4:4. E.g. see HEVC 4:2:2 and 4:4:4 since IceLake. This means that ideally we should match input chroma subsampling vs specific hardware supported subsampling. All in the context of bits per pixel (e.g. for 8 bit format we could fall back to NV12, for 10 bit format to P010LE). There are complex cases like 4:2:2 input for HEVC with free kernel build which would not support encoding. Both 4:4:4 and 4:2:0 would be supported so we could go down to 4:2:0 or up to 4:4:4. I am not even sure it is possible to easily query hardware for support as avcodec user. There is easy way to solve this in non-automatic way - just let user specify intermediate format for hardware conversion. Advantages:
Disadvantages:
The last case is rather rare. |
Fall back to P010LE for 10 bit depth data and NV12 otherwise. This may possibly lead to some loss of information on modern hardware supporting 4:2:2 and 4:4:4 chroma subsampling (e.g. HEVC with >= IceLake and 4:2:2 or 4:4:4 input). Related to #26
Fixed in 59f416f It is enough to set Note left in the code:
This means that fix may not be future proof (encoding 4:4:4 chroma input with HEVC and >= IceLake platform may possibly drop chroma information to 4:2:0, needs testing). |
Before FFMpeg (avcodec) 4.1 (e.g. Ubuntu 18.04 with 3.4) VAAPI FFmpeg pipeline performs colour conversions automatically.
Example:
Since FFMpeg 4.1 (e.g. Ubuntu 20.04 with 4.2.4) this is no longer possible and results in
From FFMpeg trac the solution is to use
vaapi_scale
filter to perform (hopefully) hardware conversion.f2ab50f implements proof-of-concept working for bgr0 in 4.2.4 (Ubuntu 20.04).
Related to RNHVE#25
Related to UNHVD#27
The text was updated successfully, but these errors were encountered: