title: Get video size after Save this video to Photo Library in iOS
body: <p>I created Camera using <code>UIImagePickerController</code>, after take a video. I clicked on Use Video, I saved this video to Photo library. And now I want to get size of this video. I used <code>AlAssetLibrary</code> to save video to Photo library. How can get size of the video has just taken? Please help me. Thanks in advance.</p>
  
  <pre><code>    -(void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
  
      ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
      NSURL *recordedVideoURL= [info objectForKey:UIImagePickerControllerMediaURL];
      if ([library videoAtPathIsCompatibleWithSavedPhotosAlbum:recordedVideoURL]) {
          [library writeVideoAtPathToSavedPhotosAlbum:recordedVideoURL
                                      completionBlock:^(NSURL *assetURL, NSError *error){}
           ];
      }
  
  }
  </code></pre>
  
  <p>I tried below code to get size of video but not works:</p>
  
  <pre><code> ALAssetRepresentation *rep = [alasset defaultRepresentation];
  Byte *buffer = (Byte*)malloc(rep.size);
  NSError *error = nil;
  NSUInteger buffered = [rep getBytes:buffer fromOffset:0.0 length:rep.size error:&amp;error];
  NSData *data = [NSData dataWithBytesNoCopy:buffer length:buffered freeWhenDone:YES];
  </code></pre>