VSE dynamic retiming design #100337
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
5 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#100337
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?
Goal of this feature is to allow variable strip playback speed, using new retiming system.
Overview
speed_factor
strip property is redundant and will be replaced by tool functionality.Tool overview
To be clarified
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscribers: @fsiddi, @iss
Added subscriber: @Sergey
It seems that the task is mainly raising questions about some implementation specific details, and the actual design is only mentioned briefly. It makes it rather hard to comment on.
What is the difference between dynamic and animated strip playback speed? If the speed is animated, does it mean that the strip length changes during animation playback?
Using the dedicated tool sounds fine. But what you mean by mainly? What are the other ways of retiming manipulation.
There are some missing concepts here.
How one adds a control point to a strip? Can't think of what existing concept of a strip this relates to, and the proposal does not mention new concepts.
Are the control points mapped to the footage frame, scene frame?
I am not sure if speed is a good mental model. It is harder to understand intuitively what result changing the speed will lead to. To me the better mental model is more in realms of thinking of control point which corresponds to a frame from the media, and user drags it in timeline to the position where they want it to be in the edit.
Is not really clear where the requirement is coming from.
If the idea is to build a tool based on what we already have then to me it seems that the tool will utilize the "Speed Factor" and its f-curve. But then to me it seems that the ownershop, speed, and speed vs. frame mapping questions are answered implicitly:
If the tool is good then I do not see a reason for artists to go to animation editor to tweak the curve. And even if they do go into the animation editor, and manage to create a really long strip it is not any different from them doing it already. So not sure this is a huge factor for decision making.
If we ignore the speed factor for a moment, and want to design tool which manipulates its own data structures, using a LUT or curve mapping for frames rather than speed seems more straightforward for understanding. But then it is unclear where the requirement of the animation curve is coming from.
The tricky part here is to figure out how to make this new tool and the speed factor to not conflict with each other. Some conversion code and deprecation of the speed factor property could be a solution.
Caching topics I would not go into until the rest of the design is clear and is working. To me caching is a performance improvement technique which does not dictate the design, but rather follows it.
The sound seeking issue is to me also something more into realms of current code limitation rather than a design issue. Not really familiar with the way Audaspace works, but it doesn't seem to be impossible to solve issues you're bringing up.
For the pitch of the audio strips my question is: is it even the way artists expect to operate on audio? I am not really sure why on a user level we should treat retiming of audio and video strips any different.
Added subscriber: @neXyon
That is correct. From my point of view feature design is quite simple, but implementation has to be discussed. Perhaps will try to use just term "retiming" as it is most general.
There is none, I just did not want to use term "animated playback speed", because I don't think it's quite appropriate. Term "Dynamic" isn't quite appropriate either probably. More correct description would be: The feature can produce strip which frames do not have linear mapping onto original content.
No strip length is constant during playback
Tool system uses operators, so these should be available and usable by their own. What I wanted to say, that "focal point" of this feature will be a tool with set of gizmos and operators.
I was describing tool UX here. This could be implemented as adding keyframes on property. in which case this would not be new concept. But here I propose a new concept of strip owning this dataset. I have proposed to store data in
FCurve
, which I am not sure it's best idea. It provides most functionality I need, but has also some limitations, that could be hard to work around.Agree, but since I was explaining UX, there it makes more sense.
Correct, though here I propose to not build the tool based on what we already have.
My point was, that our animation system can do things my tool would not be able to handle correctly. For example curve modifiers and drivers. That is my main point against this route - it's too complex to be handled "externally" from another module. Also this complexity is not useful in vast majority of use-cases.
Perhaps I am using term "animation curve" more freely, than I should. What I mean is we have to have dataset that describes mapping of strip frames onto frames of original content.
This is least of my concern probably - I can convert animated speed to new system. I have talked with fsiddi, that if speed changes at any particular frame, I can add control point in new system that would be linear. This should preserve existing animation well.
I don't (necessarily) want to deprecate
speed_factor
property - if you want to play whole strip x times faster or slower, Changing property is easiest way to achieve this. But this could be facilitated by tool as well just so all controls are at same place.Well my main point here was that solution where we use existing speed property for retiming will require cache, while solution I am proposing does not.
Also I wanted outline limitations of caching, but that is not that of a problem.
Yes I went bit too far ahead here... But from talk in D15652, @neXyon suggests, that Audaspace should copy existing animation from Blender, so this is something to keep in mind.
It depends. For example in Heist movie sound pitch animation was used quite extensively to produce some sound effects. Other use case may be to use constant interpolation when you want to just change speed.
This would be limitation of retiming system I propose, that it wouldn't support these smooth sweeps natively and these would have to be constructed by multiple "retiming points". I think this is still beneficial even if this is done extensively, because changes in speed do happen usually in few seconds, then speed is again constant. So amount of points the system has to care about is still much lower. Retiming system that would use existing animation system and
speed_factor
property will require "retiming point" per each frame internally.There is also one thing I forgot to mention in UX section - when retiming portion of strip, I want the tool to preserve existing animation as much as possible
With retiming system I propose, you can calculate 1 factor by which you offset all keyframes in portion of strip between 2 control points. Contrast to that, retiming system using
speed_factor
property would behave in a way, that if you change speed value of a keyframe, there is nothing really to calculate - you will have to do snapshot of frame mapping before the change, then map each keyframe to original content frame, and then use new frame map to map original content frame to new keyframe frame. That is if such point even exists in the map, if not you will have to interpolate it somehow.In this task I mainly wanted to discuss implementation of retiming with relation to existing vs new animation system. I mainly wanted to discuss this, because since we have animation system already, it would make sense to use it. So I analyzed both solutions and my conclusion is that using existing animation system would be much more complex (as in performance and also code-wise). Therefore I want to handle frame mapping internally in sequencer, that would be "opaque to user" and mainly visualized via tool system. For extensibility I am happy to provide API alongside operators to handle data though.
Just a note, that implementation I am proposing is in D15945. Patch is pretty much feature complete, there are some bugs and code needs cleanup in general. I am quite confident with the design, so my plan is to use it unless you see obvious holes in it (what I have written here).
It is not easily or really productive to think of implementation details when the design is not clearly communicated. There are some aspects which comes naturally from the design, and for other cases it is hard to think of details without knowing what are they really about.
To me it is still not really clear why there was a decision made to think in terms of speed. To me it does not seems to be the best mental model to think of the re-timing tool on an artistic level. It could be something hidden as an implementation detail, but even then it will have downsides.
I do like the direction your suggestion goes. To me it is indeed easier to think of frame re-mapping rather than speed. I see what you mean there, but strictly speaking reducing duration of a strip (hence, increasing it speed) is still a linear mapping.
I see. Not sure the control point is the best name for it. In a 3D world control points is something else.
For the f-curve I am not really convinced either, especially after seeing the WIP patch. Seems that it is not that much functionality is re-used from f-curve. and the f-curve is something much more overkill. If there are no plans to support non-linear interpolation it might be more clear to implement evaluation on an array of points (the rest of operations already seems to be implemented on the sequencer side). Alternatively, there are two possibilities:
This is a bit confusing. The proposed patch re-uses parts of the animation system.
I am getting even more confused. My point was that whether data manipulated by a tool is visible in the animation editors is kind of secondary when it comes to focusing on designing the tool.
But now the sentence reads as if the animation system is more powerful. What does it mean?
Is almost never having two things controlling the same thing ends up in a good UX. Thinking aloud: you can imagine that there could be a context menu with some pre-defined remapping choices: 50%, reset to 100%, 200%, Custom. I do not really see how having both curve mapping and (possibly animated) speed factor makes it easy and understandable from the implementation point of view.
This sounds awesome. The rest i can not really follow. It goes in some implementation design with decisions which are not very well explained.
I am not even really convinced going the speed route in implementation is the best way to preserve frame at which the control point is added. Speed will intrinsicly lead to precision loss. If i was working on this feature I'd operate on the frame level: when user inserts a retiming point it has fixed frame number of the input media it corresponds to. Then when strip is rendered there is a linear interpolation between 2 adjacent retiming points to get the frame number to be used from the input. This seems to be the robust solution from preserving frame at the retiming tool. Not sure if such approach was considered, and if so, why it was discarded.
From testing the current patch it does not seem that the frame at a keyframe is preserved well. Shrinking the input media of 250 frames to 100 frames makes the last visible frame from the strip to go from 250 to 247. Inserting retiming point somewhere in the middle of the strip and moving it around could lead to couple of frames off. To me it seems to be easily avoidable side effects if a different implementation is used.
I understand that. If there is still something unclear in user level design, I am happy to clarify it.
There wasn't such decision. Speed is important for users and for Audaspace currently.
So far I have iterated to term "retiming handle". I think that is very obvious and quite clear.
I thought that using FCurves is something that can be changed rather easily with versioning if I want to change it later on. I was thinking of refactoring function
insert_keyframe()
soBKE_fcurve
functions are available to more modules, but did not do it before I am firmly decided, that I will actually use FCurves.My main reasons against using it is for implementation of freeze frames and possibly other features like "speed gradient" to smoothly transition between 2 different playback speeds (it's likely that users would want this). Simplest solution would be to have flag for retiming handle. With FCurves this would be not straightforward to do.
Curve mapping is something I was thinking of as alternative. If I understand you correctly, I would have own implementation of this curve mapping with own type, handle/point/keyframe management and evaluation is that correct?
I am fine with using parts as long as they work for purpose and don't cause aditional issues. What I meant is to not use animation system as a whole.
I don't think it is secondary. Retiming data do have constraints which makes them unsuitable to be managed with anizmation system. We could make changes to resolve this, but I argue, that it's not in our interest.
I think you are correct here, so I guess
speed_factor
could be removed completely. However I need to fix sound seeking first, then convert sound animation to this system, otherwise the tool would not work with sound at all. Also missing ability to do gradual speed changes would be a regression. That is why I don't really want to touch it at this moment. I am quite confident, that I would be able to implement these missing features fairly quickly though.This is exactly what I am proposing, so I am happy that we are in agreement on this point.
But I have implemented this - playback speed isn't used anywhere in code apart from printing text labels on strip.
I have noticed this, there must be 1-off error somewhere. There are many smaller issues like this, will fix them soon.
After reading your reply I can see it now.
From the original description it was not really obvious what is the decision decision and what is, so to speak, a consequence of that.
Retiming Handle sounds clear to me.
It isn't difficult to implement versioning code for any DNA tructure.
Not sure how commonly used such feature is, or what is the UI/UX for it is. But intuitively, it can be represented as handles of a bezier control points (as opposite of segmented linear interpolation).
To me there are bigger concerns of using FCurves. Unless it is really intended to be used the same as as animation system uses it, it should not be used. The current patch uses FCurve as just a container of linearly inetrpolated control points. This is rather inefficient and weird design decision.
Initially i meant just use the
CurveMapping
as is. It is much better choice thanFCurve
. But that was based on the design description at that time, and at the code state of that time. There was no concept of the frame freeze mentioned until now.If there are video-editing specific features planned to be added having a dedicated data structure would make much more sense.
I think it would be a lot helpful to take a step back and write the proper proposal. It is important to have the design description, mental models in place. A lot of questions will be naturally answered by a good design document.
Some quick inspiration from the animation module:
quit.blend
on exit optional)Ok I will update description and describe the tool as best as I can. Usually I start with rough idea and smooth out details in the process, so there are still things I want to discuss.
Thank for the update! It reads much more clearly to me now.
I am not so much sure about the gradient. Having frame freeze is something what I expect will be requested soon.
With the updated state of the patch the DNA seems to be flexible enough to support frame freeze around handle. But I am not sure how the gizmo interaction should look like for it. But also, is it something we need to resolve for an initial tool commit, or something we can look into later? Just to understand priorities, you know.
Yeah, to be honest, i did not figure out how to remove the handle :(
Adding the control feels a bit suboptimal. Maybe it is the best of what we can do. But would be very nice to have @fsiddi feedback on it, to see what is the most efficient and straightforward UI/UX from an editor perspective.
I think it would be very good longer-term goal. Basically, avoid having multiple properties/tools controlling effectively the same thing. For the initial integration it might be easier to leave it as-is, and do the do-versions and such after the tool is in and tested and such.
Btw, we've been talking about audio before, and now I do not see it in the clarification list. Did you figure it out? Kinda curios what would it mean to have re-timing tool for it.
Keep in mind, a decision like "we keep audio out of the scope of the initial patch" is also fine. Is more matter of having clear timeline and what/when/if is being tackled.
We can talk about this later. Currently it is not implemented and not discussed at all.
It's removed by clicking on bottom part of the handle - the triangle. It should change cursor to eraser...
Yes, it is bit awkward. I wanted to propose adding retiming handles anywhere on strip and drawing image of the frame either in preview or in timeline even, but I wouldn't like either solution. Normally you want to retime whole strip or from particular frame, and that is most likely your current frame.
I don't have very strong opinion here for existance of dedicated property or versioning. Decision to not touch these was mostly because of time constraint.
My only argument to keep Speed Factor property is for simplicity and ease of use. I know it's bad argument, but I stand by it :)
Technically there is not much to be clarified from design standpoint - it should work same way as retiming for video.
On implementation level, things are bit more complicated, because audaspace does not seek correctly. So if you retime sound, and play it back from middle of strip, it would play incorrect part of strip with correct pitch.
So what I need to do, after new system is in place or at least agreed on is:
So timeline I propose is to:
Make Separate patch for sound strip support itself (items 1, 3, 4).
Francesco said, that sound support is unconditional, but agreed with this order of events. After this, I am fine with removing Speed Factor property as well.
Ultimately though plan is to discuss this more in detail after conference, due to time constraints. Francesco said, that it would be possible to have this as tool and change design later, but he would prefer to finish all features as much as possible before pushing to master.
The timeline seems good to me.
Can you elaborate on the meaning of "sound support is unconditional"? I am not sure I understand it correctly.
It means that sound retiming must be supported, otherwise feature won't pass functional review.
As long as it means that the functional; review to determine the project is done, it is fine.
But we should move towards the final goal as a series of incremental patches. The video and audio code paths are rather isolated in Blender, so I do not see it helps mixing all of the changes into a single patch, and do not see a reason to hold off in commit of video retiming support once that part of the project is done.
I understand need for sound support, though I would agree, that if the basic functionality is done, I don't see reason not to include it in release (assuming master is open for such features...). But that is also quite different topic to discuss.
Since I brought up the importance of having retiming working for sound, I also agree that having working (and released) retiming for video alone is a good start, especially since audio and video are not linked together.
Added subscriber: @tintwotin
Does this approach support reverse playing as the existing Speed effect does?
Design does support that, but it's currently prevented by UI
Had a review a few days ago with Richard. Here is the feedback:
Is there a way to move handles with Python API ?
@reijaff Yes, there is.
https://docs.blender.org/api/master/bpy.types.RetimingHandle.html#bpy.types.RetimingHandle
blender 3.6
Is it suppose to work like that?
>>> bpy.context.sequences[0].retiming_handles.values()[1].timeline_frame
52
>>> bpy.context.sequences[0].retiming_handles.values()[1].timeline_frame = 32
>>> bpy.context.sequences[0].retiming_handles.values()[1].timeline_frame
124
And there is a bug with bpy.ops.sequencer.retiming_handle_add
to reproduce:
when it works:
It definitely shouldn't work like that, will check this. In future I recommend to create bug report.
Also I would recommend to stick with actual API, instead of using operators - use
C.sequences[0].retiming_handles.add()