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

fcp xml invalid start time for clip. #322

Open
alatdneg opened this issue Sep 7, 2018 · 5 comments
Open

fcp xml invalid start time for clip. #322

alatdneg opened this issue Sep 7, 2018 · 5 comments
Labels
bug A problem, flaw, or broken functionality. stale time calculations

Comments

@alatdneg
Copy link

alatdneg commented Sep 7, 2018

Seems to be a bug in the code that calculates the start time..

start time doesn't match premiere, which is 1002

[
    {
        "OTIO_SCHEMA": "Clip.1", 
        "effects": [], 
        "markers": [], 
        "media_reference": {
            "OTIO_SCHEMA": "ExternalReference.1", 
            "available_range": {
                "OTIO_SCHEMA": "TimeRange.1", 
                "duration": {
                    "OTIO_SCHEMA": "RationalTime.1", 
                    "rate": 29.97, 
                    "value": 5744
                }, 
                "start_time": {
                    "OTIO_SCHEMA": "RationalTime.1", 
                    "rate": 29.97, 
                    "value": 500
                }
            }, 
            "name": null, 
            "target_url": "file://localhost/test.wav"
        }, 
        "metadata": {}, 
        "name": "test.wav", 
        "source_range": {
            "OTIO_SCHEMA": "TimeRange.1", 
            "duration": {
                "OTIO_SCHEMA": "RationalTime.1", 
                "rate": 60.0, 
                "value": 2246
            }, 
            "start_time": {
                "OTIO_SCHEMA": "RationalTime.1", 
                "rate": 60.0, 
                "value": 1001.001001001001
            }
        }
    }
]

clipitem id="clipitem-732" premiereChannelType="stereo">
	<masterclipid>masterclip-81</masterclipid>
	<name>hw_seq_full_mix.wav</name>
	<enabled>TRUE</enabled>
	<duration>11500</duration>
	<rate>
		<timebase>60</timebase>
		<ntsc>FALSE</ntsc>
	</rate>
	<start>0</start>
	<end>2246</end>
	<in>0</in>
	<out>2246</out>
	<pproTicksIn>0</pproTicksIn>
	<pproTicksOut>9508665600000</pproTicksOut>
	<file id="file-81">
		<name>test.wav</name>
		<pathurl>file://localhost/test.wav</pathurl>
		<rate>
			<timebase>30</timebase>
			<ntsc>TRUE</ntsc>
		</rate>
		<duration>5744</duration>
		<timecode>
			<rate>
				<timebase>30</timebase>
				<ntsc>TRUE</ntsc>
			</rate>
			<string>00;00;16;20</string>
			<frame>500</frame>
			<displayformat>DF</displayformat>
		</timecode>
		<media>
			<audio>
				<samplecharacteristics>
					<depth>16</depth>
					<samplerate>48000</samplerate>
				</samplecharacteristics>
				<channelcount>2</channelcount>
			</audio>
		</media>
	</file>
	<sourcetrack>
		<mediatype>audio</mediatype>
		<trackindex>1</trackindex>
	</sourcetrack>
</clipitem>
@alatdneg
Copy link
Author

alatdneg commented Sep 7, 2018

I'm starting to think that preimier is doing something odd here, as 1001.001001001 is valid as far as I can see.

@apetrynet
Copy link
Contributor

Unless this is related to my drop-frame implementation it might have to do with the fcp_xml adapter scaling source_ranges.
source_range = otio.opentime.TimeRange( start_time=start_time.rescaled_to(item_rate), duration=otio.opentime.RationalTime(out_frame - in_frame, item_rate) )
Take a look here in the adapter code.

Perhaps @bashesenaxis might be able to answer this?

@alatdneg
Copy link
Author

alatdneg commented Sep 7, 2018

Ta, I suspect this stuff is going to be a bit tricky, it's probably easier to just get someone on ourside to fix the timeline,29.97 audio in a 60fps time line is just confusing.. as audio has no rate

@jminor jminor added the bug A problem, flaw, or broken functionality. label Sep 7, 2018
@jminor
Copy link
Collaborator

jminor commented Sep 14, 2018

Hmmm. Yeah, I'm not sure what the intent of the rescaled_to is in the code that @apetrynet pointed out above. @bashesenaxis can you give us a hint about what you intended with that?

@bashesenaxis
Copy link
Contributor

I am not 100% sure at this point anymore what the point of that rescale was. Some thoughts below.

  • Looking at the code, start_time should already be in item_rate. But perhaps because we are adding the timecode to it, this could change? Then if we force a rescale, at least we know what the rate will be in the end.
  • I don`t think that xml is very aware of the different rates of the clips on a timeline. The rate is defined by the timeline.
  • If you have independent clip rates and available rates, this could imply that your clip is stretched in time. At the time of writing the adapter, that was not a feature of otio and I am not entirely sure how it will behave with scaled clips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A problem, flaw, or broken functionality. stale time calculations
Projects
None yet
Development

No branches or pull requests

4 participants