5
votes

I am using AVAssetExport to export a composition of asset tracks. But the problem is I can't get the Frame rate mode to be constant, the meta data for the video being exported is as follows:

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : [email protected]
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 3s 502ms
Bit rate : 684 Kbps
Width : 480 pixels
Height : 480 pixels
Display aspect ratio : 1.000
Frame rate mode : Variable
Frame rate : 30.000 fps
Minimum frame rate : 28.571 fps
Maximum frame rate : 30.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.099
Stream size : 292 KiB (90%)
Title : Core Media Video
Encoded date : UTC 2013-11-22 00:27:28
Tagged date : UTC 2013-11-22 00:27:32
Color primaries : BT.709
Transfer characteristics : BT.709
Matrix coefficients : BT.601

My code being used for the export is as follows:

AVAssetExportSession *session = [[AVAssetExportSession alloc] initWithAsset:mixComposition presetName:AVAssetExportPresetPassthrough];
session.outputURL = [NSURL fileURLWithPath:finalVideoPath];
session.outputFileType = AVFileTypeMPEG4;
[session exportAsynchronouslyWithCompletionHandler:^{
    switch ([session status]) {
        case AVAssetExportSessionStatusFailed:
            LogError(@"Export failed: %@", [session error]);
            break;
        case AVAssetExportSessionStatusCancelled:
            Log(@"Export canceled");
            break;
        case AVAssetExportSessionStatusCompleted:
            Log(@"Export successfully");
            break;
        default:
            Log(@"Export session status unknown");
            break;
    }
}];
1

1 Answers

0
votes

This means the asset being export has frame durations which are not constant. If the frames all have exactly the same duration, then you'll see the "Frame rate mode" reported as "Constant".