VSE 2.0: Media transform redesign #78988

Closed
opened 2020-07-16 14:31:18 +02:00 by Sergey Sharybin · 22 comments

Current behavior of the media added to the sequencer stack: it gets stretched to fill the entire resolution of the final frame. In order to transform the media some special option is to be enabled, which makes media to have its original resolution in the final result. This is not very intuitive and rather cumbersome.

More expected behavior is to make media to scale-to-fit the final sequencer resolution, and consider this a baseline. All the transformation (scale, position, crop) are relative to this size.

For example, if sequencer is configured to be FullHD, adding 4K image will scale it down, so artists see the entire image. Scaling the image by 0.5 makes it so it covers half of the final frame. Transform operates in the final frame space.

Crop tool should not move the image, it should just remove pixels from sides, leaving rest of the pixels where they are (to compare with the current behavior, the desired crop is a combination of current crop plus current translation).

Mockup from the art team:
vse_improvements_02.jpg

Amending change tasks:

  • #82755 (Sequencer: Improve motion-picture workflow)
  • #84535 (Resolve inconsistency of sequencer import setting in header)
Current behavior of the media added to the sequencer stack: it gets stretched to fill the entire resolution of the final frame. In order to transform the media some special option is to be enabled, which makes media to have its original resolution in the final result. This is not very intuitive and rather cumbersome. More expected behavior is to make media to scale-to-fit the final sequencer resolution, and consider this a baseline. All the transformation (scale, position, crop) are relative to this size. For example, if sequencer is configured to be FullHD, adding 4K image will scale it down, so artists see the entire image. Scaling the image by 0.5 makes it so it covers half of the final frame. Transform operates in the final frame space. Crop tool should not move the image, it should just remove pixels from sides, leaving rest of the pixels where they are (to compare with the current behavior, the desired crop is a combination of current crop plus current translation). Mockup from the art team: ![vse_improvements_02.jpg](https://archive.blender.org/developer/F8699080/vse_improvements_02.jpg) Amending change tasks: - #82755 (Sequencer: Improve motion-picture workflow) - #84535 (Resolve inconsistency of sequencer import setting in header)
Author
Owner

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Owner

Added subscribers: @Sergey, @fsiddi, @iss, @dfelinto

Added subscribers: @Sergey, @fsiddi, @iss, @dfelinto

Added subscriber: @TakingFire

Added subscriber: @TakingFire

@Sergey, @fsiddi I have started working on this issue recently, and arrived at similar design with few differences and open questions:

  • Do we need to expose anchor point for scale and rotation? Alternative would be to use operator to manipulate with image interactively in preview and calculate correct position, rotation and scale with anchor pernamently set to image center.
  • I expect with current pipeline and WIP patch to use nearest interpolation for preview (fastest). We can chose bilinear or bicubic for render. Should we pick highest quality possible (slowest)? Or should we expose this option to user?
  • Should we be able to use relative values for pixels?
  • I think we no longer need "Use Crop" checkbox - it is using same codepath as "Offset", so it has no impact on performance. Should it be removed and should we use only seq->strip->transform?
  • To initialize scale to fit, when strips are added to timeline, I think we should flag strips with SEQ_FLAG_SCALE_NOT_CALCULATED and calculate scale on demand.

Over all, I would ask, how this feature should be different to existing transform effect strip?

Ideally we should be able to perform all transform operaions at once, I have used code from transform effect (2D matrix transform). However, it is measurably slower, than current implementation:

  • 2D matrix transform: 62ms
  • Current scaling method: ~1ms

Therefore I think it would be better to use matrix transform code only when rotation is used. Scaling can be probably implemented in faster method as well.

WIP patch (made before this task was created, so it's not as proposed) D8393: Media transform redesign

@Sergey, @fsiddi I have started working on this issue recently, and arrived at similar design with few differences and open questions: - Do we need to expose anchor point for scale and rotation? Alternative would be to use operator to manipulate with image interactively in preview and calculate correct position, rotation and scale with anchor pernamently set to image center. - I expect with current pipeline and WIP patch to use nearest interpolation for preview (fastest). We can chose bilinear or bicubic for render. Should we pick highest quality possible (slowest)? Or should we expose this option to user? - Should we be able to use relative values for pixels? - I think we no longer need "Use Crop" checkbox - it is using same codepath as "Offset", so it has no impact on performance. Should it be removed and should we use only `seq->strip->transform`? - To initialize scale to fit, when strips are added to timeline, I think we should flag strips with `SEQ_FLAG_SCALE_NOT_CALCULATED` and calculate scale on demand. Over all, I would ask, how this feature should be different to existing transform effect strip? Ideally we should be able to perform all transform operaions at once, I have used code from transform effect (2D matrix transform). However, it is measurably slower, than current implementation: - 2D matrix transform: 62ms - Current scaling method: ~1ms Therefore I think it would be better to use matrix transform code only when rotation is used. Scaling can be probably implemented in faster method as well. WIP patch (made before this task was created, so it's not as proposed) [D8393: Media transform redesign](https://archive.blender.org/developer/D8393)
Author
Owner

Do we need to expose anchor point for scale and rotation?

General programming approach: do not create entities unless is absolutely needed.
If the anchor point is just a slider, it will be really counter-intuitive to use. If it's a tool to scale and rotate, it can use translation for anchor.

I expect with current pipeline and WIP patch to use nearest interpolation for preview (fastest). We can chose bilinear or bicubic for render. Should we pick highest quality possible (slowest)? Or should we expose this option to user?

Please stop exposing settings to user. This is not a solution to anything.

Should we be able to use relative values for pixels?

Not sure what you mean by this. Users might still operate in the pixel values measured in the final 100% resolution. But the system should work in a way that scaling final resolution up or down the system should transparently scale pixel values accordingly.

Long story short: rendering 4K movie from 2K scene should be as simple as setting render scale to 200%.

I think we no longer need "Use Crop" checkbox

Once the old behavior of image fitting is removed, there is no need in Use Crop option at all. It is super easy to check crop values to be 0 and avoid any processing of the image in this case.

To initialize scale to fit, when strips are added to timeline, I think we should flag strips with SEQ_FLAG_SCALE_NOT_CALCULATED and calculate scale on demand.

This is an implementation detail.

It also seems too fragile, because the resolution in the file can change outside of Blender. The system could be smart enough to always do proper fitting.

The scale for fitting is purely runtime, it is not a state, and is not something users are interacting with.

Over all, I would ask, how this feature should be different to existing transform effect strip?

Transofmration is rather very fundamental operation during video editing. Having it as an effect seems weird. While it might work the same, requirement to always add effect every time one need to translate seems an overkill.

However, it is measurably slower, than current implementation

The new code is non-vectorized single-threaded implementation. This is not how one does real-time video processing tool in 2020.

> Do we need to expose anchor point for scale and rotation? General programming approach: do not create entities unless is absolutely needed. If the anchor point is just a slider, it will be really counter-intuitive to use. If it's a tool to scale and rotate, it can use translation for anchor. > I expect with current pipeline and WIP patch to use nearest interpolation for preview (fastest). We can chose bilinear or bicubic for render. Should we pick highest quality possible (slowest)? Or should we expose this option to user? Please stop exposing settings to user. This is not a solution to anything. > Should we be able to use relative values for pixels? Not sure what you mean by this. Users might still operate in the pixel values measured in the final 100% resolution. But the system should work in a way that scaling final resolution up or down the system should transparently scale pixel values accordingly. Long story short: rendering 4K movie from 2K scene should be as simple as setting render scale to 200%. > I think we no longer need "Use Crop" checkbox Once the old behavior of image fitting is removed, there is no need in Use Crop option at all. It is super easy to check crop values to be 0 and avoid any processing of the image in this case. > To initialize scale to fit, when strips are added to timeline, I think we should flag strips with `SEQ_FLAG_SCALE_NOT_CALCULATED` and calculate scale on demand. This is an implementation detail. It also seems too fragile, because the resolution in the file can change outside of Blender. The system could be smart enough to always do proper fitting. The scale for fitting is purely runtime, it is not a state, and is not something users are interacting with. > Over all, I would ask, how this feature should be different to existing transform effect strip? Transofmration is rather very fundamental operation during video editing. Having it as an effect seems weird. While it might work the same, requirement to always add effect every time one need to translate seems an overkill. > However, it is measurably slower, than current implementation The new code is non-vectorized single-threaded implementation. This is not how one does real-time video processing tool in 2020.

Hi, do you have a screen-capture/screenshot of the patch in action?

Hi, do you have a screen-capture/screenshot of the patch in action?

In #78988#985973, @fsiddi wrote:
Hi, do you have a screen-capture/screenshot of the patch in action?

2020-07-27 16-45-00.mkv

It is quick proof of concept, values work exactly as in transform strip (that's why I was asking questions above) with exception, that it works on files bigger than project resolution.

Also I have one more detail I want to point out - in mockup, crop values are described as relative to transformed image. I can imagine situations where you want crop applied pre-transform, as well as post. Later, you can do easily with "dummy" strip, former you can't do easily. Not sure what would be absolutely optimal solution if you wanted both or which situation is more used. I would guess pre-transform one is better option.

In #78988#985645, @Sergey wrote:
Please stop exposing settings to user. This is not a solution to anything.

I don't want to. Anchor point is in mockup picture and interpolation is pickable in transform strip.

The new code is non-vectorized single-threaded implementation. This is not how one does real-time video processing tool in 2020.

Sure I was using blocks I had available. My question was perhaps a bit stupid, but what I was trying to ask is how hard we should try to optimize performance to absolute maximum. I guess answer would be "depends".

> In #78988#985973, @fsiddi wrote: > Hi, do you have a screen-capture/screenshot of the patch in action? [2020-07-27 16-45-00.mkv](https://archive.blender.org/developer/F8723289/2020-07-27_16-45-00.mkv) It is quick proof of concept, values work exactly as in transform strip (that's why I was asking questions above) with exception, that it works on files bigger than project resolution. Also I have one more detail I want to point out - in mockup, crop values are described as relative to transformed image. I can imagine situations where you want crop applied pre-transform, as well as post. Later, you can do easily with "dummy" strip, former you can't do easily. Not sure what would be absolutely optimal solution if you wanted both or which situation is more used. I would guess pre-transform one is better option. > In #78988#985645, @Sergey wrote: > Please stop exposing settings to user. This is not a solution to anything. I don't want to. Anchor point is in mockup picture and interpolation is pickable in transform strip. > The new code is non-vectorized single-threaded implementation. This is not how one does real-time video processing tool in 2020. Sure I was using blocks I had available. My question was perhaps a bit stupid, but what I was trying to ask is how hard we should try to optimize performance to absolute maximum. I guess answer would be "depends".
Author
Owner

Also I have one more detail I want to point out - in mockup, crop values are described as relative to transformed image.

Not sure what exactly that means. In the patch crop sliders seems to not do anything.

Sure I was using blocks I had available. My question was perhaps a bit stupid, but what I was trying to ask is how hard we should try to optimize performance to absolute maximum.

There is IMB_processor_apply_threaded and IMB_processor_apply_threaded.

From technical side, performance is achieved by both technology (threading, vectorization) and by minimizing amount of work to be done. There is #78992 a parent task for performance.


It also feels wrong to talk about patch which does not implement this design.
Do we all agree on the design level?

> Also I have one more detail I want to point out - in mockup, crop values are described as relative to transformed image. Not sure what exactly that means. In the patch crop sliders seems to not do anything. > Sure I was using blocks I had available. My question was perhaps a bit stupid, but what I was trying to ask is how hard we should try to optimize performance to absolute maximum. There is `IMB_processor_apply_threaded` and `IMB_processor_apply_threaded`. From technical side, performance is achieved by both technology (threading, vectorization) and by minimizing amount of work to be done. There is #78992 a parent task for performance. --- It also feels wrong to talk about patch which does not implement this design. Do we all agree on the design level?

In #78988#986056, @Sergey wrote:

Also I have one more detail I want to point out - in mockup, crop values are described as relative to transformed image.

Not sure what exactly that means. In the patch crop sliders seems to not do anything.

I meant this mockup:
vse_improvements_02.jpg

It also feels wrong to talk about patch which does not implement this design.
Do we all agree on the design level?

Yes overall I agree, I just wanted to clarify some details

> In #78988#986056, @Sergey wrote: >> Also I have one more detail I want to point out - in mockup, crop values are described as relative to transformed image. > > Not sure what exactly that means. In the patch crop sliders seems to not do anything. I meant this mockup: ![vse_improvements_02.jpg](https://archive.blender.org/developer/F8699080/vse_improvements_02.jpg) > It also feels wrong to talk about patch which does not implement this design. > Do we all agree on the design level? Yes overall I agree, I just wanted to clarify some details

Added subscriber: @tintwotin

Added subscriber: @tintwotin

In the mock-up, shouldn't Scale be in percentage?

Maybe these values should also be exposed as tools in the Toolbar like in the Transform Tools add-on(https://github.com/doakey3/VSE_Transform_Tools):
{F8723706, size = full}

Exposed anchor point in an enum and a drawn cross in the Transform Tools add-on:
{F8724574, size = full}

In the mock-up, shouldn't Scale be in percentage? Maybe these values should also be exposed as tools in the Toolbar like in the Transform Tools add-on(https://github.com/doakey3/VSE_Transform_Tools): {[F8723706](https://archive.blender.org/developer/F8723706/Transform_toolbar.gif), size = full} Exposed anchor point in an enum and a drawn cross in the Transform Tools add-on: {[F8724574](https://archive.blender.org/developer/F8724574/Anchor.gif), size = full}
Author
Owner

Also I have one more detail I want to point out - in mockup, crop values are described as relative to transformed image.

Not sure what exactly that means. In the patch crop sliders seems to not do anything.

I meant this mockup

Ah, if I understand it correct (and @fsiddi will correct me if i'm wrong), those are the pixel values after the image has been auto-scaled to fit. As in, the crop is measured in the final frame pixels at 100% resolution.

It is also not unreasonable to expect that user-defined scale and rotation is applied after crop: otherwise one would need to constantly re-adjust crop after scaling the image.

In the mock-up, shouldn't Scale be in percentage?

Percentage is same as 0 to 1 factor. To me it seems that exposing it as a factor is more intuitive: scale 1.5 means the image is 1.5 times bigger. Scale of 150% is well, some people might have different idea of how that works (one might consider this additive).

>>> Also I have one more detail I want to point out - in mockup, crop values are described as relative to transformed image. >> Not sure what exactly that means. In the patch crop sliders seems to not do anything. > I meant this mockup Ah, if I understand it correct (and @fsiddi will correct me if i'm wrong), those are the pixel values after the image has been auto-scaled to fit. As in, the crop is measured in the final frame pixels at 100% resolution. It is also not unreasonable to expect that user-defined scale and rotation is applied after crop: otherwise one would need to constantly re-adjust crop after scaling the image. > In the mock-up, shouldn't Scale be in percentage? Percentage is same as 0 to 1 factor. To me it seems that exposing it as a factor is more intuitive: scale 1.5 means the image is 1.5 times bigger. Scale of 150% is well, some people might have different idea of how that works (one might consider this additive).

In #78988#986382, @Sergey wrote:

Also I have one more detail I want to point out - in mockup, crop values are described as relative to transformed image.

Not sure what exactly that means. In the patch crop sliders seems to not do anything.

I meant this mockup

Ah, if I understand it correct (and @fsiddi will correct me if i'm wrong), those are the pixel values after the image has been auto-scaled to fit. As in, the crop is measured in the final frame pixels at 100% resolution.

Yes, those are the pixel values after the image has been auto-scaled to fit.

Regarding @tintwotin previous post: having visual transforms is desirable, but let's cover the basics first.

> In #78988#986382, @Sergey wrote: >>>> Also I have one more detail I want to point out - in mockup, crop values are described as relative to transformed image. >>> Not sure what exactly that means. In the patch crop sliders seems to not do anything. >> I meant this mockup > > Ah, if I understand it correct (and @fsiddi will correct me if i'm wrong), those are the pixel values after the image has been auto-scaled to fit. As in, the crop is measured in the final frame pixels at 100% resolution. > Yes, those are the pixel values after the image has been auto-scaled to fit. Regarding @tintwotin previous post: having visual transforms is desirable, but let's cover the basics first.

Added subscriber: @AndyCuccaro

Added subscriber: @AndyCuccaro

Added subscriber: @clayhands

Added subscriber: @clayhands

This issue was referenced by e1665c3d31

This issue was referenced by e1665c3d31906aed195bfdc10a4dd7582f31b1f5

This issue was referenced by 5713626422

This issue was referenced by 571362642201a743168cdf4c827a59c09c40414b

This issue was referenced by 9441413cb2

This issue was referenced by 9441413cb242f549ba1f86621ff72e90418313df

Marking as resolved, all relevant commits are attached here.

Marking as resolved, all relevant commits are attached here.

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Richard Antalik self-assigned this 2021-04-01 11:59:56 +02:00

Added subscriber: @zelgadis

Added subscriber: @zelgadis

In #78988#985645, @Sergey wrote:
It also seems too fragile, because the resolution in the file can change outside of Blender. The system could be smart enough to always do proper fitting.

@Sergey "the resolution in the file can change outside of Blender" - this is exactly our case.
Unfortunately, since Blender 2.90 the situation when resolution changes outside of Blender is not handled properly.
This breaks workflow of our studio, I wrote in detail here - https://developer.blender.org/T78986#1477138
Any help is appreciated.

> In #78988#985645, @Sergey wrote: > It also seems too fragile, because the resolution in the file can change outside of Blender. The system could be smart enough to always do proper fitting. @Sergey "the resolution in the file can change outside of Blender" - this is exactly our case. Unfortunately, since Blender 2.90 the situation when resolution changes outside of Blender is not handled properly. This breaks workflow of our studio, I wrote in detail here - https://developer.blender.org/T78986#1477138 Any help is appreciated.
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
9 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#78988
No description provided.