Converted mov to mp4, output file not working in default android video player
Converted mov to mp4, output file not working in default android video player
- Subject: Converted mov to mp4, output file not working in default android video player
- From: Devarshi Kulshreshtha <email@hidden>
- Date: Fri, 04 Sep 2015 15:53:57 +0530
I used below code to convert an mov file to mp4 in my mac os x app:
- (IBAction)convertAction:(id)sender {
NSString *sampleMov = [@"~/Desktop/sample_mov.mov"
stringByExpandingTildeInPath];
AVURLAsset *avAsset = [AVURLAsset URLAssetWithURL:[NSURL
fileURLWithPath:sampleMov]
options:nil];
// NSArray *compatiblePresets = [AVAssetExportSession
exportPresetsCompatibleWithAsset:avAsset];
AVAssetExportSession *exportSession = [[AVAssetExportSession alloc]
initWithAsset:avAsset presetName:AVAssetExportPresetPassthrough];
NSString *videoPath = [@"~/Desktop/sample_mp4_movie.mp4"
stringByExpandingTildeInPath];
exportSession.outputURL = [NSURL fileURLWithPath:videoPath];
NSLog(@"videopath of your mp4 file = %@",videoPath); // PATH OF YOUR
.mp4 FILE
exportSession.outputFileType = AVFileTypeMPEG4;
[exportSession exportAsynchronouslyWithCompletionHandler:^{
switch ([exportSession status]) {
case AVAssetExportSessionStatusFailed:
NSLog(@"Export failed: %@", [[exportSession error]
localizedDescription]);
break;
case AVAssetExportSessionStatusCancelled:
NSLog(@"Export canceled");
break;
default: break;
} }];
}
Though it has successfully converted the file, the same file when sent to
an android device could not be played :(
Any ideas?
--
Thanks,
Devarshi
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden