Note that there are some explanatory texts on larger screens.

plurals
  1. POConverting .swf to .mov or .m4v ios objective c
    primarykey
    data
    text
    <p>I am trying a demo project where i am bundling the test.swf file and converting it to .mov or .m4v using AVFoundation. But everytime i try i get the following Error Failed </p> <p>Export Failed: Error Domain=AVFoundationErrorDomain Code=-11838 "Operation Stopped" UserInfo=0x109a9a200 {NSLocalizedDescription=Operation Stopped, NSLocalizedFailureReason=The operation is not supported for this media.}</p> <p>Here is my code to change the format</p> <pre><code> AVURLAsset *videoAssetOriginal = [AVURLAsset assetWithURL:videoURL]; // NSLog(@"videoAssetOriginal %@",videoAssetOriginal); AVMutableComposition *mixComposition = [AVMutableComposition composition]; // NSString *outputPath; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *outputPath = [documentsDirectory stringByAppendingPathComponent: [NSString stringWithFormat:@"videoExport.m4v"]]; AVMutableCompositionTrack *compositionTrackOriginal = [mixComposition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; AVAssetTrack *clipVideoTrackB = [[videoAssetOriginal tracksWithMediaType:AVMediaTypeVideo] lastObject]; [compositionTrackOriginal insertTimeRange:CMTimeRangeMake(kCMTimeZero, videoAssetOriginal.duration) ofTrack:clipVideoTrackB atTime:kCMTimeZero error:nil]; NSLog(@"mixComposition %@",mixComposition); AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset:mixComposition presetName:AVAssetExportPresetPassthrough]; // if i keep presetName :AVAssetExportPreset1280x720 then it will only original video is rotated and trimmed video is removed from the video... and if i keep AVAssetExportPresetPassthrough then it shows black screen exporter.outputFileType = AVFileTypeQuickTimeMovie; exporter.outputURL = [NSURL fileURLWithPath:outputPath]; videoURL = [NSURL fileURLWithPath:outputPath]; [exporter exportAsynchronouslyWithCompletionHandler:^{ switch ([exporter status]) { case AVAssetExportSessionStatusFailed: NSLog(@"Export Failed: %@", [exporter error]); break; case AVAssetExportSessionStatusCancelled: NSLog(@"Export canceled"); break; case AVAssetExportSessionStatusCompleted: NSLog(@"Video Exported !"); break; default: break; } }]; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload