tags:

views:

2446

answers:

13

I'm trying to build a video recorder without jailbreaking my iPhone (i've a Developer license). I began using PhotoLibrary private framework, but i can only reach 2ftp (too slow). Cycoder app have a fps of 15, i think it uses a different approach. I tried to create a bitmap from the previewView of the CameraController, but it always returns e black bitmap.

I wonder if there's a way to directly access the video buffer, maybe with IOKit framework.

Thanks Marco

A: 

If you're intending to ever release your app on the App Store, using a private framework will ensure that it will be rejected. Video, using the SDK, simply isn't supported.

August
+1  A: 

I'm aware that it'll be rejected from the AppStore. It's for my own, just for fun and more (i don't want to jailbreak).

Marco

Marco
This would better be a comment on August's response than a response in its own right. :)
Chris Hanson
A: 

To capture the video you can see when the Camera is active requires fairly sophisticate techniques, not exposed by any framework/lib out of the box.

A: 

I used a non documented UIWindow method to get the current displayed frame as CGImageRef. Now it works successfully!!

If you would, and if i'm allowded, i can post the code that do the trick.

Marco

Marco
A: 

Hey can you tell me the trick or post the code?

+1  A: 

Here is the code:

image = [window _createCGImageRefRepresentationInFrame:rectToCapture];

Marco

Marco
A: 

I am also trying to do a video recorder but I am getting memory warning from OS. How you are handling sequence of images?

+1  A: 

That is the big problem. So far i've solved using some temp fixed size buffers and detach a thread for every buffer when is full. The thread will save the buffer content in the Flash memory. Launching some heavy threads, heavy beacause each thread access the flash, will slow the device down and the refresh of the camera view. Buffers cannot be big, because you will get memory warning, and cannot be small because you will freeze the device, because of too many threads and accesses to the flash memory at a time. The solution resides in balancing buffer size and number of threads.

I haven't already tried to use sqlite3 db to store images binary data, but i don't if will be a better solution.

PS: to speed up class methods call, avoid the common solution [object method] because of how method call works, but try to get and save the method address as below.

From Apple ObjC doc:

"The example below shows how the procedure that implements the setFilled: method might be called: void (setter)(id, SEL, BOOL); int i; setter = (void ()(id, SEL, BOOL))[target methodForSelector:@selector(setFilled:)]; for ( i = 0; i < 1000, i++ ) setter(targetList[i], @selector(setFilled:), YES); "

Marco

Marco
A: 

Marco, In your Dec 2 post you said "I used a non documented UIWindow method to get the current displayed frame as CGImageRef."

Would you post the code?

A: 

Craig, in my Jan 31 post i posted the code ;).

Marco

Marco
A: 

is there a link to the code. I dont see a Jan 31 post.

Wilma
image = [window _createCGImageRefRepresentationInFrame:rectToCapture];
Marco
A: 

On iPhone 3.0, createCGImageRefRepresentationInFrame is not available So how to make it possible on iPhone 3.0 to capture frames

A: 

When anyone is done do you think you could save the Xcode folder into a .zip compression and upload the zip to MegaUpload or something? I would love to have this app, but I'm not that great at coding. I have a developers license so putting it on an iPhone won't be a problem... Thanks!

iTz Sillohsk8