Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • how to compress the recorded video

    • 0
    • 2
    • 0
    • 0
    • 1
    • 0
    • 0
    • 0
    • 900
    Comment on it

    Hello all,
    Use the following code to compress the recorded video quality and size.

    - (void)compressRecordedVideoWithInputURL:(NSURL*)inputURL 
                                       outputURL:(NSURL*)outputURL 
                                         handler:(void (^)(AVAssetExportSession*))handler
    {
    
         [[NSFileManager defaultManager] removeItemAtURL:outputURL error:nil];
                AVURLAsset *asset = [AVURLAsset URLAssetWithURL:inputURL options:nil];
                AVAssetExportSession *exportSession = [[AVAssetExportSession alloc] initWithAsset:asset presetName:AVAssetExportPresetLowQuality];
                exportSession.outputURL = outputURL;
                exportSession.outputFileType = AVFileTypeQuickTimeMovie;
                [exportSession exportAsynchronouslyWithCompletionHandler:^(void) 
                {
                    handler(exportSession);
                    [exportSession release];
                }];
    }
    

 1 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: