views:

6766

answers:

4

Hey

Could anyone advise on whether the iPhone SDK 3.0 still does not allow access to the raw camera pixel data

This is how it was with all the previous SDKs and I thought it must have been a move by Apple to ensure they were the first ones to implement the video recording. Since 3.0 now has video recording, and as far as im aware the situation remains the same, then evidently I was wrong.

What I am wondering is what is apple playing at? Why aren't they allowing us to write crazy super-cool augmented reality applications on the iPhone.

Any ideas?

+3  A: 

No, with SDK 3.0 and a new Iphone 3G S you can actually capture movies using the provide APIs. You are restricted to 10 minutes video.

In the UIImagePickerControllerDelegate, you can now find UIImagePickerControllerMediaType. This specifies the media type selected by the user. The value is an NSString object containing a type code such as kUTTypeImage or kUTTypeMovie.

This method has been added:

imagePickerController:didFinishPickingMediaWithInfo: Tells the delegate that the user picked an image or movie. This method is optional.

  • (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info

Parameters picker The controller object managing the image picker interface.

info A dictionary containing the original image and the edited image, if an image was picked; or a filesystem URL for the movie, if a movie was picked. The dictionary also contains any relevant editing information. The keys for this dictionary are listed in “Editing information keys.”

Discussion Your delegate object’s implementation of this method should pass the specified media on to any custom code that needs it and then dismiss the picker view.

When editing is enabled, the picker view presents the user with a preview of the currently selected image or movie along with controls for modifying it. (This behavior is managed by the picker view prior to calling this method.) If the user modifies the image or movie, the editing information is available in the info parameter. The original image is also returned in the info parameter.

Maximum movie duration is 10 minutes. If a user picks a movie that is longer in duration than 10 minutes, they are forced to trim it before saving it.

Implementation of this method is optional, but expected.

Availability Available in iPhone OS 3.0b and later.

unforgiven
but you're saying i should record a video then work on it. I am talking about real-time operation on each frame coming back from the camera.
zenna
This is still forbidden. It was not clear (at least to me) in your question that you were asking for real time access to each single frame captured by the camera.
unforgiven
+1  A: 

I have a followup question. I was able to use the video recording capability from within an app. I get back a dictionary that contains an NSURL to the movie, but it's in localhost/private/...

What is the next step? How do I do something with this recorded file? Can I access this local file for the sake of playback? And what about transferring it to a remote server?

Thanks in advance!

You need to create a new instance of MPMoviePlayerController using the Media Player Framework. Initialize it with the method- (id)initWithContentURL:(NSURL *)urlpassing as the url, the UIImagePickerControllerMediaURL field available in the dictionary returned by (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
unforgiven
has anybody tried yet to open and read the file and parse the header yourself?
David Maymudes
A: 

I'm trying to upload a file from a recorded video stored on the iPhone - I have everything all lined up and ready to go except that I can't seem to find the NSURL parameter to get the location of the media file from the editingInfo...

What do I do to get the NSURL?

[editingInfo NSURL]; ???

Thanks!

If you want to ask a new question you should use the "Ask Question" button in the top right, not post it as an answer to an old question. If you want to reference this thread you can always link to it from the new question.
sth
A: 
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info

{   
    NSURL *videoURL = [info objectForKey:UIImagePickerControllerMediaURL];

        /* Now put some code here to either write it to a folder or play it

    [self dismissModalViewControllerAnimated:YES];

}
mrburns05