title: How to get metadata/exif from a mp4 in iOS?
body: <p>I have a UIImagePickerController to pick a video with. How can I view the exif data of the video and or the metadata? This is what I have tried so far. What else can I try? Here is a sample file I've been using. <a href="https://drive.google.com/file/d/0B6zrWYe4_e7iNVM4MWRXTjRnWk0/edit?usp=sharing" rel="nofollow">https://drive.google.com/file/d/0B6zrWYe4_e7iNVM4MWRXTjRnWk0/edit?usp=sharing</a></p>
  
  <pre><code>-(void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info{  
  
  
  
  //method 1
  
  NSLog(@"%@",info); 
  NSURL* assetURL=[info objectForKey:UIImagePickerControllerReferenceURL];
  //This is what my asseturl looks like
  //assets-library://asset/asset.MP4?id=A37A6038-DAA7-4D96-B0C6-1A5E1FC6D8F9&amp;ext=MP4
  NSString* value=NULL;
  [assetURL getResourceValue:&amp;value forKey:NSURLFileSizeKey error:nil];
  NSLog(@"%@",value); //this is always nil
  
  
  
  //method 2
  AVURLAsset *videoAss = [AVURLAsset assetWithURL:assetURL];
  
  //I get nothing back from this
  NSLog(@"%@",[videoAss metadataForFormat:AVMetadataKeySpaceQuickTimeMetadata]);
  
  //I get nothing back from this either
   NSLog(@"%@",[videoAss metadataForFormat:AVMetadataKeySpaceCommon]);
  
  
  //method 3
  
      ALAssetsLibrary *assetLibrary=[[ALAssetsLibrary alloc]init];
  [assetLibrary assetForURL:assetURL resultBlock:^(ALAsset *asset) {
      //My asset is non nil
      NSLog(@"%@",asset);
      ALAssetRepresentation* rep=[asset defaultRepresentation];
  
      //My metaData is nil.
      NSDictionary* metaData=[rep metadata];
      NSLog(@"%@",metaData);
  } failureBlock:^(NSError *error) {
      NSLog(error);
  }];
  }
  </code></pre>