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

Only one clip added to track when they have the same duration #10

Open
stephanedebove opened this issue Sep 11, 2024 · 0 comments
Open

Comments

@stephanedebove
Copy link

Following up on an issue I originally posted here.

[x ] Incorrect Functionality or bug

Description

I’m using a python script to generate a timeline exported to an xml file. I think I’ve encountered a bug: when I add two clips of the same duration on the same track on my timeline, only one of them is added to my xml file. For instance, this timeline is exported correctly, with two distinct <clipitem> generated in the xml:

Timeline(
    "TimeLine1", 
    Stack(
        tracks, [
            otio.schema.Track(
                name='Video track 1', 
                children=[
                    otio.schema.Clip(
                        name='file.mp4', 
                        media_reference=otio.schema.ExternalReference(
                            target_url='C:\\file.mp4'
                        ), 
                        source_range=otio.opentime.TimeRange(
                            start_time=otio.opentime.RationalTime(value=0, rate=25), 
                            duration=otio.opentime.RationalTime(value=50, rate=25)
                        ), 
                        metadata={}
                    ), 
                    otio.schema.Clip(
                        name='file.mp4', 
                        media_reference=otio.schema.ExternalReference(
                            target_url='C:\\file.mp4'
                        ), 
                        source_range=otio.opentime.TimeRange(
                            start_time=otio.opentime.RationalTime(value=0, rate=25), 
                            duration=otio.opentime.RationalTime(value=75, rate=25)
                        ), 
                        metadata={}
                    )
                ], 
                source_range=None, 
                metadata={}
            )
        ], 
        None, 
        {}
    )
)

(notice both clips have a different duration)

But this timeline is NOT exported correctly, I get only one <clipitem> in my xml file (the behavior I’m expecting is two clips of the same duration following each other on video track 1. Both clips are made from the same file):

Timeline(
    "TimeLine1", 
    Stack(
        tracks, [
            otio.schema.Track(
                name='Video track 1', 
                children=[
                    otio.schema.Clip(
                        name='file.mp4', 
                        media_reference=otio.schema.ExternalReference(
                            target_url='C:\\file.mp4'
                        ), 
                        source_range=otio.opentime.TimeRange(
                            start_time=otio.opentime.RationalTime(value=0, rate=25), 
                            duration=otio.opentime.RationalTime(value=50, rate=25)
                        ), 
                        metadata={}
                    ), 
                    otio.schema.Clip(
                        name='file.mp4', 
                        media_reference=otio.schema.ExternalReference(
                            target_url='C:\\file.mp4'
                        ), 
                        source_range=otio.opentime.TimeRange(
                            start_time=otio.opentime.RationalTime(value=0, rate=25), 
                            duration=otio.opentime.RationalTime(value=50, rate=25)
                        ), 
                        metadata={}
                    )
                ], 
                source_range=None, 
                metadata={}
            )
        ], 
        None, 
        {}
    )
)

I simply export the timeline with

otio.adapters.write_to_file(timeline, file.xml)

Optional


Environment

Operating System: Windows
Python version if appropriate: 3.10.14
OpentimelineIO version: opentimelineio-0.17.0 (but I was having the same problem with 0.16)

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

No branches or pull requests

1 participant