Skip to content

Writer: Added pre- / post-transcribe hooks to facilitate media essence embedding#43

Merged
timlehr merged 1 commit intoOpenTimelineIO:mainfrom
timlehr:embed_hook_tlehr
Mar 27, 2025
Merged

Writer: Added pre- / post-transcribe hooks to facilitate media essence embedding#43
timlehr merged 1 commit intoOpenTimelineIO:mainfrom
timlehr:embed_hook_tlehr

Conversation

@timlehr
Copy link
Copy Markdown
Collaborator

@timlehr timlehr commented Mar 14, 2024

Link the Issue(s) this Pull Request is related to.

Requires change to OTIO core (for tests to pass):
AcademySoftwareFoundation/OpenTimelineIO#1801

Summarize your change.

This PR adds AAF adapter specific hooks that can be used to implement just-in-time transcoding of media for embedding purposes. It also adds the embed_essence argument to the write functionality, which will attempt to import media references. The new create_edgecode argument allows to control if an edge code should be applied to the AAF. Only .dnx and .aaf can be embedded. Thanks a lot @markreidvfx for your help with the embedding code. This work initially included .wav embedding support but it wasn't working properly, so it will be added back in a separate PR.

New hooks introduced:

  • otio_aaf_pre_write_transcribe: useful for transcoding media for embedding
  • otio_aaf_post_write_transcribe: useful for cleaning up in-memory timeline / reverting to original media
  • otio_aaf_pre_read_transcribe: useful to modify AAF structure in-memory before read
  • otio_aaf_post_read_transcribe: useful to extract media from AAF file post timeline transcription

Reference associated tests.

tests/test_aaf_adapter.py

@timlehr timlehr marked this pull request as draft March 14, 2024 00:16
@timlehr timlehr marked this pull request as ready for review March 20, 2024 00:10
@timlehr
Copy link
Copy Markdown
Collaborator Author

timlehr commented Mar 20, 2024

@markreidvfx I confirmed all but one of the tests producing valid results in Avid MC. However I can't get the audio import test test_transcribe_embed_wav_audio to produce results that MC can load. It errors out on import. Any chance you could have a look at this? Otherwise this PR is good for review now. :)

Screenshot 2024-03-19 at 16 42 26

@timlehr
Copy link
Copy Markdown
Collaborator Author

timlehr commented Mar 20, 2024

@reinecke @jminor After our discussion I reworked the code a little and it now offers both read and write hooks to facilitate embedding & extracting of media. I also added test coverage for all supported media types using snippets from Picchu.

@timlehr timlehr force-pushed the embed_hook_tlehr branch 2 times, most recently from 32f4364 to 00f482d Compare March 20, 2024 00:41
@timlehr timlehr changed the title Added pre- / post-transcribe hooks to facilitate media essence embedding Writer: Added pre- / post-transcribe hooks to facilitate media essence embedding Jul 20, 2024
@timlehr timlehr force-pushed the embed_hook_tlehr branch 5 times, most recently from 8d18f5c to 11fbb6e Compare October 8, 2024 20:27
@timlehr
Copy link
Copy Markdown
Collaborator Author

timlehr commented Mar 13, 2025

This PR still has an issue with audio support but the code for video embedding has been in use for a while at WDAS with reliable results. If @markreidvfx or somebody at Avid can help me fix the audio, that'd be great. Otherwise I can remove that part of the PR until we figured it out in order to get this merged sooner, rather than later.

@timlehr timlehr force-pushed the embed_hook_tlehr branch 2 times, most recently from ebfdd2f to 38bc7ce Compare March 27, 2025 07:16
@timlehr
Copy link
Copy Markdown
Collaborator Author

timlehr commented Mar 27, 2025

@markreidvfx after the last TSC I removed the audio embedding for the meantime in order to get this merged. Once fixed, I will put up a separate PR with audio embedding. AcademySoftwareFoundation/OpenTimelineIO#1801 required for the tests to pass.

@timlehr timlehr force-pushed the embed_hook_tlehr branch 2 times, most recently from 771b2ca to c52e970 Compare March 27, 2025 07:31
@timlehr timlehr requested a review from markreidvfx March 27, 2025 07:34
…e embedding

This adds AAF adapter specific hooks that can be used to implement just-in-time transcoding of media for embedding purposes. It also adds the embed_essence argument to the write functionality, which will attempt to import media references. The new create_edgecode argument allows to control if an edge code should be applied to the AAF. Only .dnx and .aaf can be embedded for now.

Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>
Copy link
Copy Markdown
Member

@markreidvfx markreidvfx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@timlehr timlehr merged commit acbbe48 into OpenTimelineIO:main Mar 27, 2025
47 checks passed
@timlehr timlehr deleted the embed_hook_tlehr branch March 27, 2025 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants