Option to configure ffmpeg YCbCr transform #25249
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#25249
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
%%%This patch add an option to control the ffmpeg swscale YCbCr->RGB conversion.
The RAW option (to keep YCbCR data in the final image) is not working yet.
I plan on adding an option for loading directly to 32bit float rgb to avoid losses.
This works in the image editor and the node compositor only for the moment.
Changing the parametr in the compositor does not trigger an node update yet :(
%%%
Changed status to: 'Open'
%%%Forgot the patch :-/
Tanks to Troy for signaling.%%%
%%%Raw YCbCr option working now. I still misses correct color management (gamma) to permit easy functional uses.%%%
Added subscriber: @mont29
Is this patch still alive/useful?
Hi,
Unfortunatey, I do not have time to develop blender anymore. This path is not maintained and probably does not apply/compile cleanly on a recent source tree, but i is pretty self contained to the ffmpeg decoding pipeline and could be ported/actualised easily.
The patch never really recieved much attention but my opinion is that it is verry usefull and that the ocio colormanagement pipeline in blender is not comlete nor correct (for most videos anyway) without this patch.
Added subscriber: @Sergey
main question is: is it even still relevant to have after OCIO integration where you can choose input color space already? And in any case, making it more intgrated into CM code (rather than a separate argument) seems to be a way to go?
Hi Sergey,
Yes it is relevant even now that OCIO is integrated. The current workflow is:
The problem is that the YcbCr colorspace is not always exactly the same (it can be rec602 rec709 or rec2020) and ffmpeg does not always detect the good one (last time I checked it was always using rec601 so very bad for HD content).
My idea for this patch was to add a option to configure this YCbCR colorpsace conversion :
Xavier
After discussing this on IRC with Sergey we concluded that the best would be:
On the image input side, this would result in the most simple and clear solution for users. It would be possible and easy to convert old files and stay mostly compatible. The only difference would be that some "out of gamut" colors that are clipped by the ffmpeg conversion now would not be clipped (and thus be outside the 0 to 1 range) by the OCIO conversion. But that is a good think in my opinion, and clipping values can also easily be done afterward if really needed.
The output/encoding side needs more thinking though because a lot of codec/color-space combination would not be valid, and of course sub-sampling will not make things easier.
Think it's possible to make YCrCb conversion LUT a bit wider than 0..1 range? Plus, currently videos are all stored as bytes, so they're clipped anyway. So seems it's not so huge a regression?
I was thinking of Matrix transform instead of LUT, they seems more appropriate and not limited to a range of input.
YCbCr darta is byte coded and thus in the 0-1 range but converting it to sRGB result in value out of the 0-1 range, currently those are clipped by the ffmpeg colorspace conversion. If we use an OCIO Matrix tranform they will not be anymore. This is good, but my concerns was that it might "brake" old files.
I didn't check if it could be a matrix in all the cases. If it could -- for sure matrix is the way to go.
If users will get all of a sudden deeper dynamic range that's kinda nice :)
It can be a matrix and I have both broadcast and full range versions. I will look into this possibly after I fix the XYZ hard coded paths.
Probably needs a bit more thought for the higher bit depth varieties.
Changed status from 'Open' to: 'Archived'
No news here since months… archiving for now, we can always reopen should the raised points be addressed.