Skip to content

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

@stephanedebove

Description

@stephanedebove

Required:


[ x] I believe this isn't a duplicate topic
[ x] This report is not related to an adapter (I’m not sure, it might now be related to an adapter, but I had this problem in the previous OpenTimelineIO versions, before I was using the fcp_xml adapter)

Select One:

[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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions