IMB: Cleanup timecode options #121001

Merged
Richard Antalik merged 15 commits from iss/blender:simplify-timecode into main 2024-05-06 17:57:07 +02:00

Remove options that are duplicate and change description of options, so
they describe bit better, how timecodes are actually used.

Timecodes in Blender have pretty much nothing in common with more widely
known term "timecode". This confused users (and developers).
There were 5 options of which 3 were exactly same. This commit leaves
user with 3 options:

  • Record Run
  • Ensure, that no frame is duplicated or skipped - "Record Run No Gaps"
  • Do not use timecodes - "None"

More verbose description was added to the definition in code.

Naming of these timecode types was kept, even if it is incorrect to not
break scripts and habits.

Remove options that are duplicate and change description of options, so they describe bit better, how timecodes are actually used. Timecodes in Blender have pretty much nothing in common with more widely known term "timecode". This confused users (and developers). There were 5 options of which 3 were exactly same. This commit leaves user with 3 options: - Record Run - Ensure, that no frame is duplicated or skipped - "Record Run No Gaps" - Do not use timecodes - "None" More verbose description was added to the definition in code. Naming of these timecode types was kept, even if it is incorrect to not break scripts and habits.
Richard Antalik added 1 commit 2024-04-24 02:44:30 +02:00
2ea7346187 IMB: Cleanup timecode options
Remove options that are duplicate, rename remaining options, so these
represent to how timecodes are actually used.

Timecodes in Blender have pretty much nothing in common with more widely
known term "timecode". This confused users (and developers).
There were 5 options of which 3 were exactly same. This commit leaves
user with 3 options:
 - Play movie normally - "Use Movie Timestamps" in menu
 - Ensure, that no frame is duplicated or skipped - "No Gaps Playback"
 - Do not use timecodes - "None"

Description of these options now describes, what these do, and
implicitly, when they should be used.

Perhaps the intention was, that if your device uses record run
or free run timecode, you could pick this option and it would just
work. But this fact and the description of these options is just
misleading.

----

Perhaps this could be more verbose in description, For example "Use Movie Timestamps" should be used if there are issues with seeking.

The DNA naming could be more precise as well - IMB_TC_INVERSE_MAPPING means, that timestamp -> frame table is generated by info from ffmpeg, we than use it as frame -> timestamp It could be called IMB_TC_USE_FRAME_PTS_MAP, but I think, that in some streams, instead of PTS, a binary offset is used. So inverse mapping is more general, but not telling much to person not knowing anything about this system.

The whole term Timecode could be renamed as well, at least in UI, so this is even less confusing
Richard Antalik added 1 commit 2024-04-24 02:47:04 +02:00
Richard Antalik requested review from Sergey Sharybin 2024-04-24 02:47:25 +02:00
Richard Antalik requested review from Sebastian Parborg 2024-04-24 02:47:55 +02:00
Sergey Sharybin requested changes 2024-04-24 10:17:01 +02:00
Dismissed
@ -29,7 +29,11 @@ extern "C" {
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
<<<<<<< HEAD

It is a very good idea to scroll through a patch you're submitting for review, to ensure it is actually code you want to be reviewed. And maybe give it a compile test as well ;)

It is a very good idea to scroll through a patch you're submitting for review, to ensure it is actually code you want to be reviewed. And maybe give it a compile test as well ;)
iss marked this conversation as resolved
@ -55,2 +55,3 @@
* frames 100 and 102.
*/
IMB_TC_RECORD_RUN = 1,
IMB_TC_INVERSE_MAPPING = 1,

I can not say I fully understand the comment and proposed naming.

Inverse from which observer perspective? it also feels that a less generic term for "mapping" can be used, to make it more explicit that there is no "map" in its programming data-structure is involved.

The "Note" part of the comment seems incomplete to me, as I do not really understand what the message is which it is trying to tell to me.

From just following the comment, a more semantically clear name would be IMB_TC_MOVIE_TIMESTAMP.

I can not say I fully understand the comment and proposed naming. Inverse from which observer perspective? it also feels that a less generic term for "mapping" can be used, to make it more explicit that there is no "map" in its programming data-structure is involved. The "Note" part of the comment seems incomplete to me, as I do not really understand what the message is which it is trying to tell to me. From just following the comment, a more semantically clear name would be `IMB_TC_MOVIE_TIMESTAMP`.
Author
Member

Will modify the comment a bit.

The thing is, that both timecode tables/maps use movie timestamps. So the data is the same pretty much, the difference is: what timeline frame / strip frame these timestamps are mapped to.

I could propose IMB_TC_NORMAL_PLAYBACK which would reflect what this is supposed to achieve.

Will modify the comment a bit. The thing is, that both timecode tables/maps use movie timestamps. So the data is the same pretty much, the difference is: what timeline frame / strip frame these timestamps are mapped to. I could propose `IMB_TC_NORMAL_PLAYBACK` which would reflect what this is supposed to achieve.
iss marked this conversation as resolved
Richard Antalik force-pushed simplify-timecode from 1c7b1ee90a to 8f0780db31 2024-04-25 00:06:02 +02:00 Compare
Richard Antalik added 1 commit 2024-04-25 00:53:29 +02:00
buildbot/vexp-code-patch-lint Build done. Details
buildbot/vexp-code-patch-linux-x86_64 Build done. Details
buildbot/vexp-code-patch-darwin-x86_64 Build done. Details
buildbot/vexp-code-patch-windows-amd64 Build done. Details
buildbot/vexp-code-patch-darwin-arm64 Build done. Details
buildbot/vexp-code-patch-coordinator Build done. Details
a92a12c82b
Use better naming, clarify usage bit more.
Author
Member

@blender-bot build

@blender-bot build

I find it a bit strange and hard to follow when there is a big difference in naming between UI and code. If the Use Movie Timestamps is clear for the UI, it will be clear for the code as well. Similarly, the No Gaps Playback is more clear than uniquness of mapping.

I am not fully concinced the current change in the name and description makes it more understandable by users. I am also not sure how much time we want to invest into such changes. Ideally we'd get rid of the timecode (which should be doable since all the previous improvements in the seeking code). Until then we can just remove the unused time code options to solve actual confusion, but leave the naming and description of Record Run and Record Run No Gaps as-is, so we don't break mental memory or scripts which automatically set-up scenes.

I find it a bit strange and hard to follow when there is a big difference in naming between UI and code. If the `Use Movie Timestamps` is clear for the UI, it will be clear for the code as well. Similarly, the `No Gaps Playback` is more clear than uniquness of mapping. I am not fully concinced the current change in the name and description makes it more understandable by users. I am also not sure how much time we want to invest into such changes. Ideally we'd get rid of the timecode (which should be doable since all the previous improvements in the seeking code). Until then we can just remove the unused time code options to solve actual confusion, but leave the naming and description of `Record Run` and `Record Run No Gaps` as-is, so we don't break mental memory or scripts which automatically set-up scenes.
Author
Member

I am not fully concinced the current change in the name and description makes it more understandable by users. I am also not sure how much time we want to invest into such changes. Ideally we'd get rid of the timecode (which should be doable since all the previous improvements in the seeking code).

I still want to remove timecodes completely, though from your comment in !108059 I had impression that it may not happen very soon.
Even if the code was removed, I think that having it in coherent state is useful if somebody would like to look at the removed code when bisecting or for whatever reason.

I find it a bit strange and hard to follow when there is a big difference in naming between UI and code. If the Use Movie Timestamps is clear for the UI, it will be clear for the code as well. Similarly, the No Gaps Playback is more clear than uniquness of mapping.

Until then we can just remove the unused time code options to solve actual confusion, but leave the naming and description of Record Run and Record Run No Gaps as-is, so we don't break mental memory or scripts which automatically set-up scenes.

I can agree on less technically correct naming scheme, perhaps even keeping completely incorrect terminology - using "record run", but I would prefer not to. Anyway, I think that having comments in the enum would be enough to build mental image of what is this code trying to do.

So will keep original naming and further clarify the comments.

> I am not fully concinced the current change in the name and description makes it more understandable by users. I am also not sure how much time we want to invest into such changes. Ideally we'd get rid of the timecode (which should be doable since all the previous improvements in the seeking code). I still want to remove timecodes completely, though from your comment in !108059 I had impression that it may not happen very soon. Even if the code was removed, I think that having it in coherent state is useful if somebody would like to look at the removed code when bisecting or for whatever reason. > I find it a bit strange and hard to follow when there is a big difference in naming between UI and code. If the `Use Movie Timestamps` is clear for the UI, it will be clear for the code as well. Similarly, the `No Gaps Playback` is more clear than uniquness of mapping. > Until then we can just remove the unused time code options to solve actual confusion, but leave the naming and description of `Record Run` and `Record Run No Gaps` as-is, so we don't break mental memory or scripts which automatically set-up scenes. I can agree on less technically correct naming scheme, perhaps even keeping completely incorrect terminology - using "record run", but I would prefer not to. Anyway, I think that having comments in the enum would be enough to build mental image of what is this code trying to do. So will keep original naming and further clarify the comments.
Richard Antalik added 7 commits 2024-04-29 09:38:48 +02:00
Richard Antalik requested review from Sergey Sharybin 2024-04-29 09:39:50 +02:00
Author
Member

I have updated the patch, just a note, that in movie clip editor "Record Run No Gaps" was named "Free Run No Gaps". So I have changed name in UI, but RNA enum is not changed. This is in reference to #120839, which started this whole thing.

I have updated the patch, just a note, that in movie clip editor "Record Run No Gaps" was named "Free Run No Gaps". So I have changed name in UI, but RNA enum is not changed. This is in reference to #120839, which started this whole thing.
Sergey Sharybin reviewed 2024-05-01 12:14:39 +02:00
@ -67,3 +72,1 @@
IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN = 4,
IMB_TC_RECORD_RUN_NO_GAPS = 8,
IMB_TC_MAX_SLOT = 4,
IMB_TC_RECORD_RUN_NO_GAPS = 2,

Can we keep the original value for IMB_TC_RECORD_RUN_NO_GAPS so that the change does not affect on the forward comaptibility?

Can we keep the original value for `IMB_TC_RECORD_RUN_NO_GAPS ` so that the change does not affect on the forward comaptibility?
Author
Member

Yes, just will have to remove for loop and hardcode array indices. But this wouldn't complicate the code I would say.

Yes, just will have to remove for loop and hardcode array indices. But this wouldn't complicate the code I would say.
iss marked this conversation as resolved
@ -160,3 +155,1 @@
"Free Run (rec date)",
"Interpolate a global timestamp using the record date and time "
"written by recording device"},
"Use for normal playback. Seek based on timestamps read from movie stream"},

Description should be mainly about describing what the option does on a user level, not when to use it. With the current wording it is unclear what the actual difference from None is.

Description should be mainly about describing what the option does on a user level, not when to use it. With the current wording it is unclear what the actual difference from None is.
Author
Member

I would say, that it is super clear - Seek based on timestamps read from movie stream vs seek in movie stream based on calculated timestamp.

Did swap the wording, but the fact that Record Run is used for normal playback is important to include, since this is like having to choose between potato peeler and slicer in meat processing plant.

I would say, that it is super clear - Seek based on timestamps read from movie stream vs seek in movie stream based on calculated timestamp. Did swap the wording, but the fact that Record Run is used for normal playback is important to include, since this is like having to choose between potato peeler and slicer in meat processing plant.

The word "normal" is very subjective, and hence more often than not is to be avoided in favour of using an explicit definition of what you actually mean here. For example: "Seek based on timestamps read from movie stream, giving the best match between scene and movie times".

The word "normal" is very subjective, and hence more often than not is to be avoided in favour of using an explicit definition of what you actually mean here. For example: "Seek based on timestamps read from movie stream, giving the best match between scene and movie times".
iss marked this conversation as resolved
@ -166,2 +159,2 @@
"Free Run No Gaps",
"Record run, but ignore timecode, changes in framerate or dropouts"},
"Record Run No Gaps",
"This timecode causes each frame procuces new image. This may break AV sync, change "

There are some typos (procuces. it's).

Something like "Effectively convert motive to an image sequence, ignoring incomplete or dropped frames, and changes in frame rate" seems to be explaining what's going on in easier terms.

There are some typos (`procuces`. `it's`). Something like "Effectively convert motive to an image sequence, ignoring incomplete or dropped frames, and changes in frame rate" seems to be explaining what's going on in easier terms.
iss marked this conversation as resolved
Richard Antalik added 1 commit 2024-05-02 10:30:56 +02:00
Sergey Sharybin reviewed 2024-05-02 12:22:33 +02:00
@ -66,4 +72,1 @@
*/
IMB_TC_INTERPOLATED_REC_DATE_FREE_RUN = 4,
IMB_TC_RECORD_RUN_NO_GAPS = 8,
IMB_TC_MAX_SLOT = 4,

It still worth having IMB_TC_NUM_TYPES here to avoid hardcoded constants later on.

It still worth having `IMB_TC_NUM_TYPES` here to avoid hardcoded constants later on.
iss marked this conversation as resolved
@ -351,25 +344,6 @@ int IMB_proxy_size_to_array_index(IMB_Proxy_Size pr_size)
}
}
int IMB_timecode_to_array_index(IMB_Timecode_Type tc)

You can still have this function, and return an index within a 2-element array. The benefit of sticking to it is that an unexpected/unhandled enumerators will at least trigger an assert.

You can still have this function, and return an index within a 2-element array. The benefit of sticking to it is that an unexpected/unhandled enumerators will at least trigger an assert.
iss marked this conversation as resolved
@ -448,3 +411,3 @@
}
SNPRINTF(index_name, index_names[i], stream_suffix, anim->suffix);
const char *index_fmt;

Do not leave unitniailized and unchecked values. Also, see the comment for the IMB_timecode_to_array_index

Do not leave unitniailized and unchecked values. Also, see the comment for the `IMB_timecode_to_array_index`
iss marked this conversation as resolved
@ -798,3 +770,3 @@
proxy_output_ctx *proxy_ctx[IMB_PROXY_MAX_SLOT];
anim_index_builder *indexer[IMB_TC_MAX_SLOT];
anim_index_builder *indexer[2];

Use IMB_TC_NUM_TYPES .

Use `IMB_TC_NUM_TYPES `.
iss marked this conversation as resolved
Richard Antalik added 1 commit 2024-05-02 12:50:14 +02:00
Sergey Sharybin reviewed 2024-05-02 16:54:47 +02:00
Sergey Sharybin left a comment
Owner

From reading the code it seems almost good now!

The main needs to be merged, and the version/versioning code updated correspondigly. And after that it will be good from my side.

@ZedDB Would you like to have a pass of review here?

From reading the code it seems almost good now! The `main` needs to be merged, and the version/versioning code updated correspondigly. And after that it will be good from my side. @ZedDB Would you like to have a pass of review here?
Richard Antalik added 1 commit 2024-05-03 15:42:21 +02:00
Richard Antalik requested review from Sergey Sharybin 2024-05-03 15:43:23 +02:00
Sergey Sharybin reviewed 2024-05-06 17:39:59 +02:00
@ -3350,0 +3378,4 @@
MovieClipProxy proxy = clip->proxy;
versioning_update_timecode(&proxy.tc);
}
}

I'd keep a new line after the } before the comment block for consistency.

I'd keep a new line after the `}` before the comment block for consistency.
Sergey Sharybin approved these changes 2024-05-06 17:44:00 +02:00
Sebastian Parborg approved these changes 2024-05-06 17:48:42 +02:00
Richard Antalik added 2 commits 2024-05-06 17:48:45 +02:00
Richard Antalik merged commit 69472c88ee into main 2024-05-06 17:57:06 +02:00
Richard Antalik deleted branch simplify-timecode 2024-05-06 17:57:10 +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
3 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#121001
No description provided.