VSE: Metadata is shown based on preview render buffer (so can easily be lost e.g. by having the "wrong" strip blend mode -- which happens to be default now) #111595

Closed
opened 2023-08-27 22:01:25 +02:00 by Matthew Hinson · 12 comments
Member

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.79

Blender Version
Broken: ever since version 3.1.0 (still broken in 4.0 alpha)
Worked in 3.0.1

"Caused by" 165cacc6f0

Above commit didnt really cause it though, it just changed the default blending mode to Alpha Over.
If you did the same in 3.0.1 and changed the blending mode to Alpha Over, you lost the metadata as well.
Only certain blending modes preserve the original ImBuf (from which the metadata is taken).
These are Replace, Cross & Gamma Cross.

Short description of error
When the VSE is in "Preview" or "Sequencer & Preview" mode, the Sidebar gets a "Metadata" tab which is supposed to show the file metadata of the currently visible image/movie. In recent Blender versions, however, it stays empty.

Exact steps for others to reproduce the error

  • Prepare a file with metadata:
    • Open the default startup scene.
    • Press F12 to render.
    • Save the render to some .png file.
  • Use the file to test the VSE:
    • Switch to the Video Sequencer and put it in "Sequencer & Preview" mode.
    • Add an Image strip and select the .png file you saved earlier.
    • Open the Sidebar and switch to the Metadata tab.
    • Notice that no metadata is listed.
    • Repeat the above steps in Blender 3.0.1 and notice that the metadata is displayed in that version.

Looking at the source code, the VSE appears to be listing the metadata of the preview render buffer - which would certainly explain why the code eventually broke.

Attempting to show the metadata of the "currently visible" image/video is maybe a bit strange anyway (what if two images are visible side by side?). It might make sense to go back to the 2.93 UI (where the metadata was shown in the "Strip" tab instead of its own "Metadata" tab), but have it actually show the metadata of the selected strip instead of the "currently visible" strip.

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3070/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.79 **Blender Version** Broken: ever since version 3.1.0 (still broken in 4.0 alpha) Worked in 3.0.1 "Caused by" 165cacc6f0 Above commit didnt really cause it though, it just changed the default blending mode to `Alpha Over`. If you did the same in 3.0.1 and changed the blending mode to `Alpha Over`, you lost the metadata as well. Only certain blending modes preserve the original ImBuf (from which the metadata is taken). These are `Replace`, `Cross` & `Gamma Cross`. **Short description of error** When the VSE is in "Preview" or "Sequencer & Preview" mode, the Sidebar gets a "Metadata" tab which is supposed to show the file metadata of the currently visible image/movie. In recent Blender versions, however, it stays empty. **Exact steps for others to reproduce the error** * Prepare a file with metadata: * Open the default startup scene. * Press F12 to render. * Save the render to some .png file. * Use the file to test the VSE: * Switch to the Video Sequencer and put it in "Sequencer & Preview" mode. * Add an Image strip and select the .png file you saved earlier. * Open the Sidebar and switch to the Metadata tab. * Notice that no metadata is listed. * Repeat the above steps in Blender 3.0.1 and notice that the metadata *is* displayed in that version. Looking at the source code, the VSE appears to be listing the metadata of the preview render buffer - which would certainly explain why the code eventually broke. Attempting to show the metadata of the "currently visible" image/video is maybe a bit strange anyway (what if two images are visible side by side?). It might make sense to go back to the 2.93 UI (where the metadata was shown in the "Strip" tab instead of its own "Metadata" tab), but have it actually show the metadata of the selected strip instead of the "currently visible" strip.
Matthew Hinson added the
Type
Report
Priority
Normal
Status
Needs Triage
labels 2023-08-27 22:01:26 +02:00
Iliya Katushenock added the
Interest
Video Sequencer
label 2023-08-27 22:42:12 +02:00
Matthew Hinson changed title from VSE: "Metadata" tab in Sidebar is seemingly always empty to VSE: Metadata tab in Sidebar no longer shows anything 2023-08-27 23:02:30 +02:00
Member

Thanks for the report. I can confirm

Thanks for the report. I can confirm
Pratik Borhade added
Module
VFX & Video
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-08-28 12:12:31 +02:00
Member

imbuf->metadata points to null somehow.

Looks like problem is during "add image strip" operation? If I open 3.0 blend file in 3.6, metadata is visible.
(Opening 3.6 file in 3.0 do not show the data)

`imbuf->metadata` points to null somehow. Looks like problem is during "add image strip" operation? If I open 3.0 blend file in 3.6, metadata is visible. (Opening 3.6 file in 3.0 do not show the data)
Member

@iss , can you check?

@iss , can you check?

imbuf->metadata points to null somehow.

Looks like problem is during "add image strip" operation? If I open 3.0 blend file in 3.6, metadata is visible.
(Opening 3.6 file in 3.0 do not show the data)

Could be, I wasn't too familiar with who this worked before so worst case I will have to bisect.

> `imbuf->metadata` points to null somehow. > > Looks like problem is during "add image strip" operation? If I open 3.0 blend file in 3.6, metadata is visible. > (Opening 3.6 file in 3.0 do not show the data) Could be, I wasn't too familiar with who this worked before so worst case I will have to bisect.
Member

"Caused by" 165cacc6f0

Above commit didnt really cause it though, it just changed the default blending mode to Alpha Over.
If you did the same in 3.0.1 and changed the blending mode to Alpha Over, you lost the metadata as well.
Only certain blending modes preserve the original ImBuf (from which the metadata is taken).
These are Replace, Cross & Gamma Cross.

From the report description:

Looking at the source code, the VSE appears to be listing the metadata of the preview render buffer - which would certainly explain why the code eventually broke.

Attempting to show the metadata of the "currently visible" image/video is maybe a bit strange anyway (what if two images are visible side by side?). It might make sense to go back to the 2.93 UI (where the metadata was shown in the "Strip" tab instead of its own "Metadata" tab), but have it actually show the metadata of the selected strip instead of the "currently visible" strip.

I agree the current logic is incredibly fragile wrt metadata.

@iss : opinions?

"Caused by" 165cacc6f0021a7a811bc369f6e6f9bc5314a292 Above commit didnt _really_ cause it though, it just changed the default blending mode to `Alpha Over`. If you did the same in 3.0.1 and changed the blending mode to `Alpha Over`, you lost the metadata as well. Only certain blending modes preserve the original ImBuf (from which the metadata is taken). These are `Replace`, `Cross` & `Gamma Cross`. From the report description: ``` Looking at the source code, the VSE appears to be listing the metadata of the preview render buffer - which would certainly explain why the code eventually broke. Attempting to show the metadata of the "currently visible" image/video is maybe a bit strange anyway (what if two images are visible side by side?). It might make sense to go back to the 2.93 UI (where the metadata was shown in the "Strip" tab instead of its own "Metadata" tab), but have it actually show the metadata of the selected strip instead of the "currently visible" strip. ``` I agree the current logic is incredibly fragile wrt metadata. @iss : opinions?
Philipp Oeser changed title from VSE: Metadata tab in Sidebar no longer shows anything to VSE: Metadata is shown based on preview render buffer (so can easily be lost e.g. by having the "wrong" strip blend mode -- which happens to be default now) 2023-08-30 17:10:44 +02:00
Member

@Sergey might be interested as well (ref 8c87af7440)

@Sergey might be interested as well (ref 8c87af74409a3e6681698ba1bf150dd6155e202f)

@lichtwerk Thanks for bisecting. It is known, that when original ImBuf is not preserved, the metadata will not be shown. You could propagate them if blending with solid color for example, but when blending 2 images, this wouldn't be possible.

What you could do in VSE is get all raw images for current frame from cache and display metadata of these. It would display only metadata of rendered images that way. This could be implemented as drawing multiple panels. Alternative (probably better) would be to draw metadata of active strip.

@lichtwerk Thanks for bisecting. It is known, that when original `ImBuf` is not preserved, the metadata will not be shown. You could propagate them if blending with solid color for example, but when blending 2 images, this wouldn't be possible. What you could do in VSE is get all raw images for current frame from cache and display metadata of these. It would display only metadata of rendered images that way. This could be implemented as drawing multiple panels. Alternative (probably better) would be to draw metadata of active strip.

This could be implemented as drawing multiple panels. Alternative (probably better) would be to draw metadata of active strip.

It is not only about showing metadata in the UI, but also storing it in the render output.

For the UI-only you can imagine showing metadata in a menu in the strip panels. And you can only do it for image/clip/scene strips.

For the metadata properly appearing in the sequencer output there are a couple of things we can do.

One is to IMB_metadata_copy(out, ibuf2); in the EARLY_DO_EFFECT branch of the seq_render_strip_stack.
This will cover the most common use of the metadata in sequencer.

Another is that the EARLY_DO_EFFECT for the alpha-over can be optimized by utilizing knowledge about alpha channel. There is no need to allocate temporary buffer and alpha-over an opaque image. I might be misremembering something but I remember Jeroen was looking into optimiation for the draw manager which utilizes knowledge about whether image has transparency. I can not quickly find exact code, but it worth exploring for the performance reasons.

> This could be implemented as drawing multiple panels. Alternative (probably better) would be to draw metadata of active strip. It is not only about showing metadata in the UI, but also storing it in the render output. For the UI-only you can imagine showing metadata in a menu in the strip panels. And you can only do it for image/clip/scene strips. For the metadata properly appearing in the sequencer output there are a couple of things we can do. One is to `IMB_metadata_copy(out, ibuf2);` in the `EARLY_DO_EFFECT` branch of the `seq_render_strip_stack`. This will cover the most common use of the metadata in sequencer. Another is that the `EARLY_DO_EFFECT` for the alpha-over can be optimized by utilizing knowledge about alpha channel. There is no need to allocate temporary buffer and alpha-over an opaque image. I might be misremembering something but I remember Jeroen was looking into optimiation for the draw manager which utilizes knowledge about whether image has transparency. I can not quickly find exact code, but it worth exploring for the performance reasons.

One is to IMB_metadata_copy(out, ibuf2); in the EARLY_DO_EFFECT branch of the seq_render_strip_stack.
This will cover the most common use of the metadata in sequencer.

I guess this would be useful when you render edit consisting of 3D renders. If that is the goal, I can do that.

Another is that the EARLY_DO_EFFECT for the alpha-over can be optimized by utilizing knowledge about alpha channel. There is no need to allocate temporary buffer and alpha-over an opaque image.

This is implemented in seq_render_strip_stack(). It is not part of seq_get_early_out_for_blend_mode(), because it needs information from ImBuf.

With given steps there is no transparency in the image and so alpha over blending should be skipped. Will check where the metadata is lost.

> One is to `IMB_metadata_copy(out, ibuf2);` in the `EARLY_DO_EFFECT` branch of the `seq_render_strip_stack`. > This will cover the most common use of the metadata in sequencer. I guess this would be useful when you render edit consisting of 3D renders. If that is the goal, I can do that. > Another is that the `EARLY_DO_EFFECT` for the alpha-over can be optimized by utilizing knowledge about alpha channel. There is no need to allocate temporary buffer and alpha-over an opaque image. This is implemented in `seq_render_strip_stack()`. It is not part of `seq_get_early_out_for_blend_mode()`, because it needs information from `ImBuf`. With given steps there is no transparency in the image and so alpha over blending should be skipped. Will check where the metadata is lost.

The optimization mentioned above looks at ibuf->planes to check if it is possibly transparent. Since the image is PNG, it assumes it is transparent, there is no process upstream, that could indicate otherwise.

So the best solution seems to be to copy the metadata.

The optimization mentioned above looks at `ibuf->planes` to check if it is possibly transparent. Since the image is PNG, it assumes it is transparent, there is no process upstream, that could indicate otherwise. So the best solution seems to be to copy the metadata.

I guess this would be useful when you render edit consisting of 3D renders. If that is the goal, I can do that.

I am not sure how sequence of PNG/EXR images with meta-data is different here?

> I guess this would be useful when you render edit consisting of 3D renders. If that is the goal, I can do that. I am not sure how sequence of PNG/EXR images with meta-data is different here?

I guess this would be useful when you render edit consisting of 3D renders. If that is the goal, I can do that.

I am not sure how sequence of PNG/EXR images with meta-data is different here?

By 3D renders I meant sequence of PNG/EXR images.

> > I guess this would be useful when you render edit consisting of 3D renders. If that is the goal, I can do that. > > I am not sure how sequence of PNG/EXR images with meta-data is different here? By 3D renders I meant sequence of PNG/EXR images.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-09-15 16:58:42 +02:00
Sign in to join this conversation.
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
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#111595
No description provided.