0

一番下のプロセスで 2 番目の数値が 0.00000 になる理由

 NSURL    *movieURL = [NSURL URLWithString:@"s26a.mov"];

NSDictionary *opts = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO]
                                                                   forKey:AVURLAssetPreferPreciseDurationAndTimingKey];                    
 AVURLAsset *urlAsset = [AVURLAsset URLAssetWithURL:movieURL options:opts]; 
 float minute = 0;
 float second = 0; 
 second = urlAsset.duration.value / urlAsset.duration.timescale; 
 NSLog(@"movie duration : %f", second);                    
4

1 に答える 1

1

次のように映画の長さを取得できます。

 Float64 durationSeconds = CMTimeGetSeconds([urlAsset duration]); // any AVURLAsset 
于 2012-08-17T04:29:49.043 に答える