AVAssetExport sets a constant frame rate

I use AVAssetExport to export the composition of asset tracks. But the problem is that I can’t get the frame rate mode constant, the metadata for the exported video looks like this:

Video
ID: 1
Format: AVC
Format / Information: Advanced Video Codec
Profile Profile: Main@L3.0 Format Settings, CABAC: Yes Format Settings, ReFrames: 2 frames Codec ID: avc1 Codec ID / Information: Advanced Video Encoding Duration: 3 s 502 m. Data transfer rate: 684 Kbps Width: 480 pixels Height: 480 pixels 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 Chromatic subsampling: 4: 2: 0















Bit Depth: 8 bits
Scan Type: Progressive
Bits / (Pixel * Frame): 0.099 Stream
Size: 292 KiB (90%)
Name: 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
Transmission specifications: BT.709
Matrix coefficients: BT.601

My code used for 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;
    }
}];
+4
source share
1 answer

, , , , . ​​ , " ", "".

0

All Articles