简体   繁体   中英

Can i use AVAssetWriter in place of AVExportSession?

I want to crop the video given the lenght and width and x and y coordinates and it seems its not at possible with avmutablecomposition so I am planning to use AVAssetWriter to crop video using its aspectFill property in video setting.

BUT MY QUESTION is can we use AVAssetWriter as a replacement for AVExportSession ??

If yes, how to initialise the AVAssetWriterInput with AVAsset object as that we do in AVExportSession ,Like this

[[AVAssetExportSession alloc] initWithAsset:videoAsset presetName:AVAssetExportPresetHighestQuality];

It's possible that what you are looking for is AVMutableComposition naturalSize property which from what it looks from here, allows scaling (not cropping) of the video to wished sizes.

https://developer.apple.com/library/mac/documentation/AVFoundation/Reference/AVMutableComposition_Class/Reference/Reference.html#//apple_ref/occ/instp/AVMutableComposition/naturalSize

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM