pierreandrem

Q: FCPXML Time

Per the FCP XML format documentation Apple states the following about FCPXML:

Time values are expressed as a rational number of seconds with a 64-bit numerator and a 32-bit denominator. Frame rates for NTSC-compatible media, for example, use a frame duration of "1001/30000s" (29.97 fps) or "1001/60000s" (59.94 fps). If a time value is equal to a whole number of seconds, the fraction may be reduced into whole seconds (for example, “5s”).

 

I am trying to calculate the time (preferably in seconds) of the following FCPXML output, please refer to the marker tag:

 

https://gist.github.com/ifeatu/5716820

 

Can anyone help?

 

Thanks

Final Cut Pro X, OS X Mountain Lion (10.8)

Posted on Jun 5, 2013 1:01 PM

Close

Q: FCPXML Time

  • All replies
  • Helpful answers

  • by DarkDana,

    DarkDana DarkDana May 12, 2016 2:48 AM in response to pierreandrem
    Level 1 (4 points)
    Video
    May 12, 2016 2:48 AM in response to pierreandrem

    Hi,

    I have the same problem. I thought it might help if I could somehow convert the duration upon export (directly to frames, for example), but I haven't found any way to do that...

     

    Anyone?

  • by Tom Wolsky,

    Tom Wolsky Tom Wolsky May 12, 2016 3:51 AM in response to DarkDana
    Level 10 (118,252 points)
    Apple TV
    May 12, 2016 3:51 AM in response to DarkDana

    DO you want to actually export frames or do you want to know the frame count? The former you can do by adding the destination save image sequence, the latter by changing the General preferences to show frames.

  • by DarkDana,

    DarkDana DarkDana May 12, 2016 4:08 AM in response to Tom Wolsky
    Level 1 (4 points)
    Video
    May 12, 2016 4:08 AM in response to Tom Wolsky

    What I'm actually interested in is seeing in the exported file the marker start in frames, or in a HH:MM:SS:FF format:

    <marker start="126/5s" duration="200/5000s" value="EOM Seg 1"/>


    Would trying your suggestion get me there?

  • by Tom Wolsky,

    Tom Wolsky Tom Wolsky May 12, 2016 4:21 AM in response to DarkDana
    Level 10 (118,252 points)
    Apple TV
    May 12, 2016 4:21 AM in response to DarkDana

    No. Are you using the latest version of XML?

  • by DarkDana,

    DarkDana DarkDana May 12, 2016 4:58 AM in response to Tom Wolsky
    Level 1 (4 points)
    Video
    May 12, 2016 4:58 AM in response to Tom Wolsky

    I believe so, yes.

    But just in case, would that make any difference?

  • by Tom Wolsky,

    Tom Wolsky Tom Wolsky May 12, 2016 5:04 AM in response to DarkDana
    Level 10 (118,252 points)
    Apple TV
    May 12, 2016 5:04 AM in response to DarkDana

    IIt's changed considerably since 2013. I dont look inside XML files just use them.

  • by DarkDana,

    DarkDana DarkDana May 12, 2016 5:22 AM in response to Tom Wolsky
    Level 1 (4 points)
    Video
    May 12, 2016 5:22 AM in response to Tom Wolsky

    Sadly, I need to parse the fcpxml file, so I need to look "under the sheets".

  • by Luis Sequeira1,

    Luis Sequeira1 Luis Sequeira1 May 12, 2016 9:01 AM in response to DarkDana
    Level 6 (12,196 points)
    Mac OS X
    May 12, 2016 9:01 AM in response to DarkDana

    In this case, just looking for the marker would not be enough.

    You are trying to convert a time value to a frame number, which also requires the knowledge of the project frame rate. This, of course, is included in the xml as well, so in principle you could write a script that parses your xml, determines the frame rate, looks for marker tags and outputs their (approximate?) frames.

     

    How easy or feasible this is depends on exactly what you need to achieve. I'd say if you all want is to extract from an xml the list of markers with frame numbers for them it is not very hard for someone with a little coding experience to craft a script using awk, or python, for example.

  • by fox_m,

    fox_m fox_m May 12, 2016 4:57 PM in response to pierreandrem
    Level 5 (5,522 points)
    Video
    May 12, 2016 4:57 PM in response to pierreandrem

    I got 25:07.00 (25min 7 sec 0 frames). It may be off by nearly a second.  What is the actual time in FCPX for the marker? (Seriously, I want to know how close it came.)

     

    The problem with calculating time in FCPXML is that it's "running time" (kinda like MIDI) and you have to track every thing from the beginning and accumulate time values which can be a wide variety of values depending on the clip in the storyline (it seems to keep it's frame rate type and frame time data in the xml instead of being "neatly" converted to project time — at least that was *my* understanding of it when I tried to write this marker to chapter marker converter several years ago [geez has it been that long??])

     

    (I had to convert your original file to a version 1.1 fcpxml file... my converter doesn't work with 1.0.)

     

    Here's the result of my test run of the script I wrote - the first section is for inserting into Quicktime Pro and the section after the spaces is for inserting with Compressor. There is an option in the script to use clip names as chapter markers, that's why one appears in the output.

     

    ::::::::::::::::::OUTPUT:::::::::::::::::::

    {QTtext}{font:Geneva}{plain}{size:12}{textColor: 65535, 65535, 65535}{backColor: 0, 0, 0}{justify:center}{timeScale:100}{width:160}{height:48}{timeStamps:absolute}{la nguage:0}{textEncoding:0}

    [00:00:00.00]

    {textBox: 0, 0, 50, 160}1985-11-10-Berkeley_part_2.m4v

    [00:25:07.00]

    {textBox: 0, 0, 50, 160}final thought

    [00:00:00.00]

     

     

     

    00:00:00:00 1985-11-10-Berkeley_part_2.m4v

    00:25:07:00 final thought

  • by DarkDana,

    DarkDana DarkDana May 12, 2016 11:51 PM in response to Luis Sequeira1
    Level 1 (4 points)
    Video
    May 12, 2016 11:51 PM in response to Luis Sequeira1

    Yes, I don't think it's very difficult either. But I wanted first to explore the option of outputting this duration directly from FCP (save a bit of time).

    Ah, well, thanks a lot: at least now I'm sure there was no other way.