• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: FCPX calculates video duration differently to QT7 and AV Foundation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FCPX calculates video duration differently to QT7 and AV Foundation


  • Subject: Re: FCPX calculates video duration differently to QT7 and AV Foundation
  • From: Kiel <email@hidden>
  • Date: Fri, 10 Mar 2017 00:35:15 +0100

Martin's math is the correct one.

Andreas

From my device

Am 09.03.2017 um 23:55 schrieb Martin Baker <email@hidden>:

Also you should try using the duration of the video track (not the asset) which should use correct timescale and align with frame boundaries.

Martin
www.digital-heaven.co.uk 
www.twitter.com/digitalheaven
------------------------------------------------------
Digital Heaven Ltd is registered in England and Wales
Company registration number: 3628396
Registered address: 55 Lynwood Drive, Worcester Park, Surrey KT4 7AE
VAT registration number: GB 736 0989 03

On 9 March 2017 at 22:48:58, Martin Baker (email@hidden) wrote:

Jon

If it’s 23.98 then the frame duration is 1001 and the timescale should be 24000. 
https://developer.apple.com/library/content/qa/qa1447/_index.html

29760/24000s is not divisible by 1001 which would explain the import error. Round it up or down to the nearest frame. Totally avoid using seconds for any calculations with video :-)

Martin Baker
www.digital-heaven.co.uk 
www.twitter.com/digitalheaven
------------------------------------------------------
Digital Heaven Ltd is registered in England and Wales
Company registration number: 3628396
Registered address: 55 Lynwood Drive, Worcester Park, Surrey KT4 7AE
VAT registration number: GB 736 0989 03

On 9 March 2017 at 22:37:44, Darrin Cardani (email@hidden) wrote:

Yeah, that’s what I was trying to figure out. I don’t see any frame (or even half-frame) number that can land you at 1.24 seconds in a 23.98 fps world or even a 24 fps world. Would you be willing to send me the clip? Maybe I could have someone here look at it and explain why it’s coming out the way it is.

Darrin

On Mar 9, 2017, at 2:13 PM, Jon Chappell <email@hidden> wrote:

It tries to use the same timescale for everything but if it won't fit it will use whatever matches the original double up to 8 decimal places. But that didn't affect this particular example because the proposed timescale was 24000 and it was able to fit 1.24 exactly within that.

That's not the issue though. My calculations are correct for the value I am receiving, which is 1.24. The problem is that FCPX says 1.24 is wrong and it's actually 1.2399888889. I could certainly calculate that value and put it in the XML file but I don't know that value exists because I don't get that from QT or AVF.

FCPX, Premiere and CinePlay all say the file is 30 frames long. When viewing the file in QT Player 7 with the timecode mode set to Frames, it strangely says it is -10 frames long.

But now I do the calculations, 30 frames at 24*(1000/1001) would be 1.25125 seconds, so no-one's getting it right. Maybe the file is corrupt.


Regards,
Jon Chappell.
CEO, Digital Rebellion LLC.

http://www.digitalrebellion.com


On Thu, Mar 9, 2017 at 1:34 PM, Darrin Cardani <email@hidden> wrote:
Jon,

How are you calculating the numerator of the clip duration? How many frames is the clip?

Darrin

On Mar 9, 2017, at 1:03 PM, Jon Chappell <jonchappell@digitalrebellion.com> wrote:

I'm generating XML to add markers to a clip inside an event and FCPX is reporting that some of the values are not on frame boundaries. The original file's frame rate is 23.98.

The value it complains about is the clip duration, which I calculated as 29760/24000s. When I import the clip manually and let FCPX export an XML in order to compare them, FCPX chooses a duration of 892792/720000s.

My duration is therefore 1.24 seconds and FCPX's is 1.2399888889.

However, it's impossible for me to produce that duration because both the QuickTime 7 API and AV Foundation say the file's duration is exactly 1.24 seconds, so my calculation is correct according to the values I'm getting from those APIs.

For QuickTime 7 I'm using the following code:

double seconds = (double)mov.duration.timeValue / (double)mov.duration.timeScale;

I thought QT 7 might not be accurate enough so I tried AV Foundation using the following:

double seconds = CMTimeGetSeconds(asset.duration);

Both produce values of exactly 1.24 for the duration. My code does not round or modify the duration in any way.

So am I wrong or is FCPX?

Regards,
Jon Chappell.
CEO, Digital Rebellion LLC.

http://www.digitalrebellion.com

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list      (Pro-apps-dev@lists.apple.com)
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
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
References: 
 >FCPX calculates video duration differently to QT7 and AV Foundation (From: Jon Chappell <email@hidden>)
 >Re: FCPX calculates video duration differently to QT7 and AV Foundation (From: Darrin Cardani <email@hidden>)
 >Re: FCPX calculates video duration differently to QT7 and AV Foundation (From: Jon Chappell <email@hidden>)
 >Re: FCPX calculates video duration differently to QT7 and AV Foundation (From: Darrin Cardani <email@hidden>)
 >Re: FCPX calculates video duration differently to QT7 and AV Foundation (From: Martin Baker <email@hidden>)
 >Re: FCPX calculates video duration differently to QT7 and AV Foundation (From: Martin Baker <email@hidden>)

  • Prev by Date: Re: FCPX calculates video duration differently to QT7 and AV Foundation
  • Previous by thread: Re: FCPX calculates video duration differently to QT7 and AV Foundation
  • Index(es):
    • Date
    • Thread