Reading metadata from video file

pho's picture

Hi,

How can I read metadata from video files?

I attached an empty video file with 2 fields of metadata.

PreviewAttachmentSize
Empty file.mov2.44 KB

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

cybero's picture
Re: Reading metadata from video file

MetaData Hootenanny is your friend http://www.applesolutions.com/bantha/MH.html Export as XML from MH. Import as XML to QC. Job done - I guess :-)

More hard core and coded http://www.mactech.com/articles/mactech/Vol.21/21.10/TheInformer/index.html

PreviewAttachmentSize
MH.xml_.zip979 bytes

pho's picture
Re: Reading metadata from video file

So XML it is, at least for now. I'll ask a friend of mine to have a look at your second link and see if he's able to develop a plug-in.

Thanks

dust's picture
Re: Reading metadata from video file

for a plugin there is sample code for qtkit on apples site. you might however use av foundations meta fetching capabilities. I have some code I made for getting core location data out of a media file. it might help you although it only returns gps data. however it would be possible to return a dictionary or structure of all the meta data putting you in the same spot as you would using cyberos solution. let me know if you solved this and I'm happy to share.

dust's picture
Re: Reading metadata from video file

here is a picker delegate function that reads meta data utilizing av foundation.... again for gps.... you would want to change the kUTType constant to something that corresponds to your media file as this is reading pictures. see attached project it might help you in developing a plugin.

-(void) imagePickerController:(UIImagePickerController *)picker 
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
 
    /*
     // Try to get the original file.
     NSURL *originalFile = [info objectForKey:UIImagePickerControllerMediaURL];
     if (originalFile) {
     NSData *fileData = [NSData dataWithContentsOfURL:originalFile];
     }
     */
 
    NSString *mediaType = [info objectForKey:UIImagePickerControllerMediaType];
    if ([mediaType isEqualToString:(NSString*)kUTTypeImage]) {
        NSURL *url = [info objectForKey:UIImagePickerControllerReferenceURL];
        if (url) {
            ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset) {
            CLLocation *location = [myasset valueForProperty:ALAssetPropertyLocation];
 
            NSLog(@"latitude %f",location.coordinate.latitude);
            NSLog(@"longitude %f",location.coordinate.longitude);
 
            };
            ALAssetsLibraryAccessFailureBlock failureblock = ^(NSError *myerror) {
                NSLog(@"cant get image - %@", [myerror localizedDescription]);
            };
            ALAssetsLibrary *assetsLib = [[ALAssetsLibrary alloc] init];
            [assetsLib assetForURL:url resultBlock:resultblock failureBlock:failureblock];
        }
 
        if([self.popoverController isPopoverVisible])
        {[self.popoverController dismissPopoverAnimated:YES];}       
    }    
}
PreviewAttachmentSize
exif_meta.zip103.17 KB

pho's picture
Re: Reading metadata from video file

thank you!

Unfortunately, I don't if we will be able to develop a plug-in now. We decided to adopt a work-flow based on csv files and it's working pretty well! We are currently using a combo actually. We're retrieving info with filename structure + csv file, so it makes the video file metadata practically unnecessary.

regards