FCPX calculates video duration differently to QT7 and AV Foundation
FCPX calculates video duration differently to QT7 and AV Foundation
- Subject: FCPX calculates video duration differently to QT7 and AV Foundation
- From: Jon Chappell <email@hidden>
- Date: Thu, 09 Mar 2017 13:03:56 -0800
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?
_______________________________________________
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