tags:

views:

61

answers:

1

How can I detect a movie orientation (portrait or landscape) or width and height of it? For example, when using UIImagePickerController:

- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingMediaWithInfo:(NSDictionary*)info {
    if ([[info valueForKey:UIImagePickerControllerMediaType] isEqualToString:(NSString*)kUTTypeMovie]) {
        NSURL *videoURL = [info valueForKey:UIImagePickerControllerMediaURL];
    }
}

how can I get this information from videoURL?

Now I'm trying to locate a video thumbnail images in /tmp directory and work with them but this method is not stable.

Thanks in advance.

A: 

You can safely assume that video is landscape if it is a standard format: 4:3, 16:9, 2.35:1 are all wider than high. If you can't assume a standard format, then it is necessary to interrogate the container's frame dimension information.

wallyk