ios - Convert video in mp4 format -


I'm a newbie and trying to create an app that records a video or selects a video from a library Instead, instead I am uploading that video to the Web. But these files are not playing in some Android devices. So I want to convert it to mp4 format.

So I want to ask that saved mov to mp4 objective-c ?

FYI has done a lot of research but I have not found any useful information. Picker.sourceType = UIImagePickerControllerSourceTypeCamera; Picker.delegate = self; Picker.showsCameraControls = Yes; Picker.allowsEditing = Yes; picker.mediaTypes = [[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie, zero]; [Self present ViewController: animated picker: yes complete: zero]; } - (zero) imagePickerController: (UIImagePickerController *) Picker didFinishPickingMediaWithInfo: (NSDictionary *) information {NSString * MediaType = [information objectForKey: UIImagePickerControllerMediaType]; If (CFStringCompare ((__bridge_retained CFStringRef) MediaType, kUTTypeMovie, 0) == kCFCompareEqualTo) {NSString * moviePath = [[information objectForKey: UIImagePickerControllerMediaURL] path]; videoURL = info [UIImagePickerControllerMediaURL]; If (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (moviePath)) {UISaveVideoAtPathToSavedPhotosAlbum (moviePath, self, zero, zero); }} [Self-propelled view controller permission: yes complete: zero]; }

You can see it can help you

You are doing the right thing .. Now you need to change the MOV file as below: mp4

  NSString * MediaType = [informationForKey. UIImagePickerControllerMediaType]; If ((__bridge_retained cfstringRef) mediaType, kutTypeMovie, 0) == kCFCompareEqualTo) {if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum (moviePath)) {NSString * docDir = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex: 0]; NSString * Movie Path = [[Info Objective: UIImagePickerControllerMediaURL] Path]; NSString * videoPath1 = [NSString stringWithFormat: @ "% @ / xyz.mov", docDir]; NSDRAEL * VIDEO URL = [Information Objectworks: UIMJPC Controller Media URL]; NSDTa * VideoData = [NSDTATA DataWith Content of URL: Video URL]; [VideoData instrument file: VideoPath 1 atom: NO]; // UISaveVideoAtPathToSavedPhotosAlbum (moviepath, self, zero, zero); }} AVURLASet * avAsset = [AVURLASET URLSATWith URL: [NSUr File URL with path: VideoPath 1] option: zero]; NSERE * Compatible Presses = [Aviation Export ExportsPareset Compatible with Asset: Avis]; If ([compatiblePresets containsObject: AVAssetExportPresetLowQuality]) {AVAssetExportSession * exportSession = [[AVAssetExportSession alloc] initWithAsset: avAsset presetName: AVAssetExportPresetPassthrough]; NSArray * path = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, yes); VideoPath = [NSString stringWithFormat: @ "% @ / xyz.mp4", [Path ObjectExtends: 0]]; exportSession.outputURL = [with NSURL file URL: VideoPath]; NSLog (@ "VPOpath's own MP3 file =% @", VideoPath); // Export your .mp4 file session. Output file type = AVFileTypeMPEG4; // CMTime Start = CMTimeMax with Seconds (1.0, 600); // CMTime duration = CMTimeMakeWithSeconds (3.0, 600); // CMTimeRange range = CMTimeRangeMake (start, duration); // export session Timorange = range; // Remove comments for Crop Video Above Lines [exportSession exportAsynchronouslyWithCompletionHandler: ^ {switch ([exportSession status]) {Case AVAssetExportSessionStatusFailed: NSLog ("Export failed:% @", [[exportSession error] localizedDescription];; break; Case AVAssetExportSessionStatus was canceled: NSLog (@ "Canceled export"); break; Default: Break; } UISaveVideoAtPathToSavedPhotosAlbum (VideoPath, Self, Zero, Zero); [Export session release]; }]; } [Self shotgun scene controller permission: yes complete: zero];    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -