title: how to get NSData from video file on disk
body: <p>Given a url like this:</p>
  
  <pre><code>file:///private/var/mobile/Applications/C133BAE7-0CBC-4E4F-826B-509B5E1EB68E/tmp/uzhMyDkL0mSI-SCVideo-Merged.mov
  </code></pre>
  
  <p>How can I get the NSData representation of this to send to a server? I've tried all of these:</p>
  
  <pre><code>NSData *videoData = [NSData dataWithContentsOfURL:url];
  NSData *videoData = [NSData dataWithContentsOfFile:[url absoluteString]];
  NSData *videoData = [[NSFileManager defaultManager] contentsAtPath:[url path]];
  </code></pre>
  
  <p><code>videoData</code> is nil every time.</p>
  
  <p>EDIT:
  For more context I am trying to use <a href="https://github.com/rFlex/SCRecorder" rel="nofollow">SCRecorder</a> to capture video.</p>
  
  <pre><code>- (void)recorder:(SCRecorder *__nonnull)recorder didCompleteSegment:(SCRecordSessionSegment *__nullable)segment inSession:(SCRecordSession *__nonnull)session error:(NSError *__nullable)error {
  
      [session mergeSegmentsUsingPreset:AVAssetExportPresetHighestQuality completionHandler:^(NSURL *url, NSError *error) {
          if (error == nil) {
              //NSData *videoData = [NSData dataWithContentsOfURL:url];
              //NSData *videoData = [NSData dataWithContentsOfFile:[url absoluteString]];
              NSData *videoData = [[NSFileManager defaultManager] contentsAtPath:[url path]];
  
          } else {
              NSLog(@"Bad things happened: %@", error);
          }
      }];
  
  }
  </code></pre>