Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OTIO export for Flame #32

Merged
merged 4 commits into from
Nov 11, 2024
Merged

Fix OTIO export for Flame #32

merged 4 commits into from
Nov 11, 2024

Conversation

robin-ynput
Copy link
Contributor

Changelog Description

Fixes custom AYON OTIO export for Flame.

  • embedded timecode not detected properly for image sequence and movies
  • image sequence source_range was relative to the available_range

##Additional info
Tested on Flame 2024.2.2.

Testing notes:

I have created a sequence in Flame under Reel 5 that creates a 25fps timeline with a mix of:

  • regular movie
  • movie with embedded timecode
  • regular image sequence
  • image sequence with embedded timecode

Here is the code to validate the results:

import ayon_flame.api as ayfapi
from ayon_flame.otio import flame_export

print("toto: ", ayfapi.CTX.selection)

seq = ayfapi.get_current_sequence(ayfapi.CTX.selection)
#with ayfapi.maintained_segment_selection(seq):
otio_timeline = flame_export.create_otio_timeline(seq)

print(otio_timeline)
v1 = otio_timeline.video_tracks()[0]
v2 = otio_timeline.video_tracks()[1]

tc_clip = v1.find_clips()[0]
notc_clip = v1.find_clips()[1]
tc_img_clip = v2.find_clips()[0]
notc_img_clip = v2.find_clips()[1]


# QT embedded timecode
tc_clip.available_range()  # TimeRange(RationalTime(86400, 24), RationalTime(100, 24))
tc_clip.source_range  # TimeRange(RationalTime(90000, 25), RationalTime(100, 25))

# QT no embedded timecode
notc_clip.available_range()  # TimeRange(RationalTime(0, 25), RationalTime(101, 25))
notc_clip.source_range  # TimeRange(RationalTime(0, 25), RationalTime(101, 25))

# Img srquene (embedded timecode)
tc_img_clip.available_range()  #TimeRange(RationalTime(87399, 24), RationalTime(101, 24))
tc_img_clip.source_range  #TimeRange(RationalTime(91040.6, 25), RationalTime(101, 25))

# Img sequence (no embedded timecode)
notc_img_clip.available_range()  # TimeRange(RationalTime(1000, 25), RationalTime(101, 25))
notc_img_clip.source_range  # TimeRange(RationalTime(1000, 25), RationalTime(101, 25))

@robin-ynput robin-ynput self-assigned this Nov 4, 2024
@robin-ynput robin-ynput added type: enhancement Improvement of existing functionality or minor addition sponsored This is directly sponsored by a client or community member labels Nov 4, 2024
Copy link
Member

@jakubjezek001 jakubjezek001 left a comment

Choose a reason for hiding this comment

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

It looks good.

Just to make sure, this will work as expected even if the timecode on the image sequence offsets the first image frame number. I see that on line 292, we are getting the timecode frame number from mediainfo, but it seems like we are not using it in the otio reference object. However, I might be wrong.

@robin-ynput
Copy link
Contributor Author

It looks good.

Just to make sure, this will work as expected even if the timecode on the image sequence offsets the first image frame number. I see that on line 292, we are getting the timecode frame number from mediainfo, but it seems like we are not using it in the otio reference object. However, I might be wrong.

I believe this is correct. I made an attempt with an EXR sequence (1000-1101) and a "01:00:00:00" embedded timecode.
Resulting ranges looks correct to me:

  • available_range (24fps) = TimeRange(RationalTime(87399, 24), RationalTime(101, 24))
  • source_range (25fps) = TimeRange(RationalTime(91040.6, 25), RationalTime(101, 25))

Does this answer your concern ?

@robin-ynput robin-ynput merged commit 58e2d02 into develop Nov 11, 2024
1 check passed
@robin-ynput robin-ynput deleted the 10_fix_otio_export branch November 11, 2024 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sponsored This is directly sponsored by a client or community member type: enhancement Improvement of existing functionality or minor addition
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants