Bruce,
Assuming there is no <timeMap> applied, then what you said should be correct: to calculate the relative position of an object, subtract its 'offset' from its parent 'start'. Just be aware that a parent is defined literally as the enclosing XML element.
For example, in the snippet below "child" is anchored to "parent", and the relative position of "child" is 15s (45 minus 30) from the start of "parent":
<video name="parent" start="30s"> <video lane="1" name="child" offset="45s"/> <!-- rel. offset = 15s (45-30) from parent start --> </video>
If 'start' isn't specified, assume it's zero:
<video name="parent"> <!-- implicit start is zero --> <video lane="1" name="child" offset="45s"/> <!-- rel. offset = 45s (45-0) from parent start --> </video>
Both values describe an object's left edge: 'offset' is in parent timecode, and 'start' defines a local (or interior) timecode.
Which particular case is not working for you?
Andrew
On Oct 17, 2011, at 11:00 AM, Bruce Sharpe wrote: Hi Andreas,
To get the timecode as displayed in the UI, you have to subtract the clip/start value from the title/offset value.
Bruce On Mon, Oct 17, 2011 at 3:54 AM, Andreas Kiel <email@hidden> wrote:
Hi all,
I still got some trouble to calculate time with FCPX XMLs
Below an example (or better a part of an FCPXML)
...
<clip offset="588200/5000s" name="2010-10-19 08:17:05" duration="271900/2500s" start="147628600/5000s" audioStart="7083115250/240000s" audioDuration="29159950/240000s" format="r5" tcFormat="NDF">
<video offset="73710100/2500s" ref="r6" name="2010-10-19 08_17_05 - v1" duration="752200/5000s" start="73710100/2500s">
<audio lane="-4" offset="1415233920/48000s" ref="r6" srcID="4" name="2010-10-19 08_17_05 - a4" duration="7221120/48000s" start="1415233920/48000s" role="dialogue"/>
<audio lane="-3" offset="1415233920/48000s" ref="r6" srcID="3" name="2010-10-19 08_17_05 - a3" duration="7221120/48000s" start="1415233920/48000s" role="dialogue"/>
<audio lane="-2" offset="1415233920/48000s" ref="r6" srcID="2" name="2010-10-19 08_17_05 - a2" duration="7221120/48000s" start="1415233920/48000s" role="dialogue"/>
<audio lane="-1" offset="1415233920/48000s" ref="r6" name="2010-10-19 08_17_05 - a1" duration="7221120/48000s" start="1415233920/48000s" role="dialogue"/>
</video>
<title lane="5" offset="73814400/2500s" ref="r7" name="Title 1" duration="48800/2500s" start="3600s">
<text>Title 1</text>
</title>
<title lane="1" offset="29540s" ref="r7" name="Type 3" duration="49200/2500s" start="3600s" enabled="0">
<text>Type 3</text>
</title>
<title lane="2" offset="29540s" ref="r7" name="Type 3" duration="49200/2500s" start="3600s" enabled="0">
<text>Type 3</text>
</title>
<gap lane="6" offset="73863200/2500s" name="Gap" duration="126600/2500s" start="3600s"/>
<clip lane="-1" offset="1418582400/48000s" name="660602T01_3" duration="1971380/48000s" start="2216804283/48000s" format="r1" tcFormat="NDF">
<audio offset="2212752001/48000s" ref="r8" duration="162s" start="2212752001/48000s" role="dialogue"/>
</clip>
<title lane="4" offset="73892700/2500s" ref="r7" name="Title 2
second line" duration="61400/2500s" start="3600s">
<text>Title 2
second line</text>
</title>
<title lane="1" offset="739237/25s" ref="r7" name="type 1" duration="62900/2500s" start="3600s" enabled="0">
<text>type 1</text>
</title>
<gap lane="7" offset="73954100/2500s" name="Gap" duration="35700/2500s" start="3600s"/>
<title lane="1" offset="73989800/2500s" ref="r7" name="Title3
Italic text" duration="25100/2500s" start="3600s">
<text>Title3
Italic text</text>
</title>
<gap lane="1" offset="74014900/2500s" name="Gap" duration="41000/2500s" start="3600s"/>
<title lane="2" offset="74055900/2500s" ref="r7" name="Title four" duration="80800/2500s" start="3600s">
<text>Title four</text>
</title>
<filter ref="r9" name="tilt_shift"/>
<filter ref="r10" name="tilt_shift_2"/>
<filter ref="r4" name="Voice or Music"/>
</clip>
...
Assuming that the 'offset' describes the offset of a clip or title from the beginning of a sequence in seconds, the offset of the titles seems to be about 8:xm:xs:xf when converted to timecode. The timeline shows 0:3:xm:xf as timecode for the titles.
Unfortunately this calculation error is not constant with the different clips, for some they are correct for others not.
So what I'm doing wrong? Any advice or help is appriciated.
Andreas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|