Page MenuHome

[WIP]VSE: Always use automatic rendersize
Needs ReviewPublic

Authored by Richard Antalik (ISS) on May 21 2021, 7:04 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This patch is very unfinished (barely started), but there are design issues that have to be addressed before development, so I will try to outline them here.
This patch includes changes from D9414: VSE: Render in size nearest to preview image


Remove render_size (=preview size) property from sequencer preview.

When Use Proxies propery is enabled, proxies will be used when possibe
for all preview sizes. Thes means that they will be downscaled from
nearest size when exact size is not built.

When preview size is larger than largest built proxy size, original file
will be used.

Code is slightly simplified with this change, but there are missing
pieces to this change which involve proxy management.


Current proxy size options don't make too much sense, because actual preview size will be much more fluid and less constrained to 4 existing options.

Currently proxies are automatically built in sizes that are actually used in any of preview area in layout.
In this patch preview area size in pixel resolution is used to determine used render size. This can be used to choose best proxy size, but this approach is not perfect, as user may use smaller screen to add files, then move to bigger one or change layout later.

Automatic proxy size switching that was implemented used explicitly defined sizes which were chosen by user. With more granular and dynamic render size, to change proxy size on fly could be very disruptive to workflow.
Example is large movie is initially used at 25% scale, so proxies are built for this size. Just zooming in to see detail can instantly trigger rebuilding for 50% and 100% size.

These issues are created by taking image size(quality) control form user where performance may be valued over quality and other way around.

Another issue is that proxy image can not be upscaled, at least not by feature implemented in D9414. This may be actually critical for this patch, because it may be possible that user has access only to proxy files, which was fine when you defined preview size manually.
This can be solved on sequencer side by upscaling nearest size proxy image, but perhaps D9414 could provide scaling in both directions?

I would propose to have list of proxy sizes in preferences for automatic setup (100% selected by default) and no automatic building for different sizes in runtime. No changes to manual proxy setup are needed for this change.

Diff Detail

Repository
rB Blender
Branch
temp-vse-no-preview-size (branched from master)
Build Status
Buildable 14680
Build 14680: arc lint + arc unit

Event Timeline

Richard Antalik (ISS) requested review of this revision.May 21 2021, 7:04 AM
Richard Antalik (ISS) created this revision.

I would propose to have list of proxy sizes in preferences for automatic setup (100% selected by default) and no automatic building for different sizes in runtime. No changes to manual proxy setup are needed for this change.

I'm a bit confused with this statement in the context of "Always use automatic rendersize". Can you explain a bit better what would be artists workflow with your proposal?

I would propose to have list of proxy sizes in preferences for automatic setup (100% selected by default) and no automatic building for different sizes in runtime. No changes to manual proxy setup are needed for this change.

I'm a bit confused with this statement in the context of "Always use automatic rendersize". Can you explain a bit better what would be artists workflow with your proposal?

This would mean that preview size in sequencer would be always defined by it's size on screen in pixels and there will be no options to choose fixed size as it is now (25% - 100%)

This would mean that preview size in sequencer would be always defined by it's size on screen in pixels and there will be no options to choose fixed size as it is now (25% - 100%)

That is how I was imagining it to be :)

Are there other aspects of the design I can help with?

Are there other aspects of the design I can help with?

I think I can use some help to make sense of this overall, because as I outlined in description, current design is not immediatelly compatible with this change.

To summarize it :

  • User won't know in what size he will be working in, so he can't really configure proxy sizes optimally. You can still have list of sizes in preferences, but it is very likely you want to use just one.
  • Suggested downscaling of movies as done in D9414: VSE: Render in size nearest to preview image could be improved if also upscaling was supported. Would that be OK? Originally I wanted to implement scaling to nearest possible size even if factor wasn't power of 2, perhaps this would clean up API a bit instead of having to initialize 10 sws_scale contexts, have one flexible?

To expand a bit on problem 1:

  • Say you have 4K video and you use 25% proxy sizes.
  • Now you have 960x540 clip you need to composite in. You don't want to use 25% proxy, because image will be awful. So you would like to use 100% proxy.

Should there be a way to manually configure proxies per strip?

Alternative could be proxies with uniform resolution (absolute size). This would guarantee you same performance across all media, but there are other design issues with that like how to tell what was resolution of original media.
Benefit is only ease of configuration and no need for code selecting best media according to current preview size. So not sure if this is something you would consider doing.

For the per-strip configuration: I do not see why it is needed. If the sequencer performance is good, I would not expect users to think about proxy sizes.
For the upscaling my concern is that it is more lossy.
For the power of two the idea was that it is easier to implement and optimize using SMID.

Unfortunately, didn't have time to finalize things on a more of design level here.

For the per-strip configuration: I do not see why it is needed. If the sequencer performance is good, I would not expect users to think about proxy sizes.

Would you suggest then to support only 100% proxy size? that would probably simplify things.

For the upscaling my concern is that it is more lossy.

Ok, makes sense.

For the power of two the idea was that it is easier to implement and optimize using SMID.

I have 2 points here:

  • Not sure if sws_scale does use more optimized path when scaling by power of 2, I will have to check this. Then you will have to scale this image again in sequencer to expected size (+ other transforms compounded).
  • In D9414 I have outlined problem of rendering image strip - All information sequencer have is "I need to render D:\image.png". What downscale to use?

If you had API where you provide size you want to get, sws_scale can do whole job and image rendering can use power of 2 transform followed by slower method, but on smaller image. Downside is relaying back information about original size.

I would suggest to do:

  • Have API like IMB_anim_absolute_near_size(..., size_x, size_y) and IMB_loadiffname_near_size(..., size_x, size_y)
  • Use only power of 2 scaling
  • Store used IMB_DOWNSCALE in ImBuf
  • Rest processing do in sequencer

I can also check how bad impact would have using exclusively 100% proxy.

Unfortunately, didn't have time to finalize things on a more of design level here.

Sure, I understand that this isn't #1 priority.

Would you suggest then to support only 100% proxy size? that would probably simplify things.

Not really what I suggest. What I suggest is to remove configuration burden from users, but still investigate the closest proxy size generation for improved performance/memory usage.
If the proxy file can be scaled down at real-time, then we can indeed only store 100% proxies on disk. But it doesn't really sound salable to me.

For the sws_scale and image sequences story -- I am not really sure why we treat image sequences different from video. You should be able to treat image sequences in the similar manner for proxies, giving similar performance and memory improvements.

Would you suggest then to support only 100% proxy size? that would probably simplify things.

Not really what I suggest. What I suggest is to remove configuration burden from users, but still investigate the closest proxy size generation for improved performance/memory usage.

Ok, What I can do is to get size of viewport (preview resolution at 1:1 scale) and consider this as baseline. Then build proxy that is closest to this resolution.
When viewport size changes, trigger build job to build new sizes if necessary.
Finally use size that is closest to real preview resolution (consider zoom level too).

For the sws_scale and image sequences story -- I am not really sure why we treat image sequences different from video. You should be able to treat image sequences in the similar manner for proxies, giving similar performance and memory improvements.

Because for movies we keep file open, so it can't be removed or changed. So you can read properties like resolution once and rely on it.
Each image is opened on demand and you don't know what you will get in advance.