I am trying to export a QuickTime movie file with a video track in DNxHD and a couple of audio tracks in "Integer (Little Endian)", into a natively supported codec, like h.264.
The export succeeds with the code below but unfortunately the output movie only contains the audio track (in AAC, which is ok). Why is it not transcoding the video track, despite not reporting any errors?
The code:
NSURL * url = [NSURL fileURLWithPath:inPath];
NSDictionary * options = @{ AVURLAssetPreferPreciseDurationAndTimingKey : @YES };
AVURLAsset * asset = [[[AVURLAsset alloc] initWithURL:url options:options] autorelease];
AVAssetExportSession * exportSession =
[AVAssetExportSession exportSessionWithAsset:asset
presetName:AVAssetExportPreset1280x720];
if (nil == exportSession)
return NO;
exportSession.outputURL = [NSURL fileURLWithPath:outPath];
exportSession.outputFileType = AVFileTypeQuickTimeMovie;
__block BOOL success = NO;
__block BOOL done = NO;
// perform the export
[exportSession exportAsynchronouslyWithCompletionHandler:^{
switch ([exportSession status])
{
case AVAssetExportSessionStatusCompleted:
NSLog(@"Export succeeded");
success = YES;
done = YES;
break;
case AVAssetExportSessionStatusFailed:
NSLog(@"Export failed: %@", [[exportSession error] localizedDescription]);
done = YES;
break;
case AVAssetExportSessionStatusCancelled:
NSLog(@"Export canceled");
break;
default:
NSLog(@"Export Session Status: %d", exportSession.status);
break;
}
}];
while (!done)
usleep(1000*250);
return success;