New, vastly enhanced iPhone 3G S video recorder enhancer released (with source code)!

I've just uploaded version 1.4 of my free(!), open-source(!) iPhone 3G S video recorder enhancer tool to Cydia. As usual, add the repository „http://www.winmobiletech.com/cy” or „http://winmobiletech.com/cy” to your Cydia client and download the new version from my repository. When the development is finally finished, I'll make the two programs be available in traditional Cydia repositories so that you don't need to access it from my private repository.

Main changes in this version:

- In SystemPlistContentWrapper, I've implemented saving and storing the min/max frame rates to AVCaptureSession.plist / AVCapture.plist. While this has little usefulness in the traditional 480p/1080p modes already supported by the previous, 1.3 version, it's of real importance in pixel-binned Full sensor mode. Why? Because if you reduce a bit the allowed frame rates (I've thoroughly tested with 10 min / 14 max frames in AVCaptureSession / AVCaptureDevices[0] / AVCaptureSessionPresetHigh / LiveSourceOptions / MaxFrameRate and MinFrameRate) and you don't let the system show any preview video (meaning you don't provide the system a preview size of 1080*800 but stick with, say, the original VGA resolution, which means a seemingly closed shutter), absolutely no „clicking” will take place!

This is of extreme importance when you just want the camera to take the interior of, say, a room or an external place with as good a resolution as possible, even with somewhat reduced frame rate (don't shoot e.g. moving vehicles!) and you know where you're pointing at by just putting it on a pre-set place; then, the again-allowed Full mode will be of extreme importance and utility.

If you don't use these values but stick with default (15/30) framerates, then, it still clicks now and then (every about 10...120 seconds).

I've played quite a lot with trying to still enable while shooting Full sensor videos. The only-working 1080*800 configuration (all other configs show a closed shutter) preview is absolutely useless even with the reduced (10 min /14 max) framerate. In this case, there is a click every 2-3 seconds(!) and the video is absolutely rubbish. Setting AVCaptureSession / AVCaptureDevices[0] / AVCaptureSessionPresetCommon / LiveSourceOptions / FullResolutionPreview from true to false doesn't help the live view case at all. Using 720*960 (instead of 1080*800) as capture and preview (otherwise the latter doesn't work) size is exactly the same (with 10/14) useless mess. That is, under 4.3.x (as opposed to 4.2.x), there is (currently) no known way of enabling preview monitoring when shooting in Full sensor mode.

Problems of the 4.3-specific no-preview Full sensor mode

- landscape orientation is not sensed (everything is shot in Portrait by default). In order to natively shoot in landscape, after you start Camera, you MUST switch to photo mode and, then, back to video mode (you don't need to take any photo in Photo mode, just switch back and fro). Then, it'll take landscape video and you won't end up having to rotate the video yourself. (OS X QuickTime won't rotate; VLC will.)

- focus is fixed at the infinity, even if you (in about half of the cases) hear a click right at the beginning. This means you'll want to shoot subjects at least 2-3m away to get a sharp image. Everything closer to you will be out of focus. An example framegrab of this is as follows. Note the screen, about 0.5 metres from the iPhone, is absolutely out of focus; the white switch, which is about 1 metres away, is still somewhat out of focus and the rest of the interior of the room, in the distance of at least 3-4 metres, is well-focused:

http://dl.dropbox.com/u/13100693/html/062011iPhone3GSCameraHack/43-3gs-fullsensor-closevsFarFocusDiffs.png

Incidentally, let me show you two 4.3.3 example video frame grabs of the same room, the first with the standard 1080p mode, the second with Full sensor mode, indoors (meaning pretty bad lighting, at least when it comes to the, compared to e.g. the iPhone 4, pretty light-insensitive sensor + lens combo of the 3G S). Both have been taken using the (under 4.3.x) maximal 1.75 Mbps data rate and, with the 1080p mode, focusing on the remote subject (about 5-6 meters from the phone). As you can see, the 1080p version is way inferior to the Full mode both video noise and resolution-wise – as was the case with the pre-iOS4.3 versions:

http://dl.dropbox.com/u/13100693/html/062011iPhone3GSCameraHack/43-3gs-1080p-restest-comparison.png

http://dl.dropbox.com/u/13100693/html/062011iPhone3GSCameraHack/43-3gs-full-restest-comparison.png

I don't think I even need to tell you which is which...

Other goodies:

- I've introduced a new textfield to the detailed view of the advanced view tab, which lets you enter the maximal data rate. In simple view, it's calculated the following way: if the data rate is less than 10000000, then, the max. rate is 10000000; otherwise, it's three times the data rate:

int maxDataRate = 10000000;
if (maxDataRate < dataRate) maxDataRate = dataRate * 3;


As this value can be also set by the user, along with the min/max frame rates, I've extended the [SystemPlistContentWrapper writeDataToSystemFile] to accommodate these new three parameters. This meant a lot of updates everywhere.

- I don't display incompatible data rates in Simple view any more under 4.3.x. I've found out that, under 4.3.x, 1750000 is the maximum data rate that can be used in any of the configurations. Of course, in iOS versions prior to 4.3, all values are displayed up to 25 Mbps. The code responsible for this is simple:

- I've fixed the Cydia update bug: Cydia no longer states there's an updated version of the app. In case you're, as a programmer, interested: when you upload a new version of your app to Cydia, you need to change the version number not only in the repo-specific Packages[.gz] file, but also in the project-specific „control” file. I've forgotten to do the latter; this is why Cydia always listed my app in the „Update available” section. Incidentally, if you encounter any other app in Cydia that has the same bug, do the following: edit /private/var/lib/dpkg/status and change the version (e.g., 1.0) to the latest one (e.g., 1.3). It'll get rid of the badge / the need to always update it. (But, of course, the best is asking the developer of the app to fix the bug himself on the Cydia repo side.)

- I've removed all the (commented-out) code letting 4.3 systems also change the old, pre-4.3-only /System/Library/PrivateFrameworks/Celestial.framework/N88/AVCapture.plist. During my last experiments (since my last post), I've found setting this is absolutely unnecessary and you won't ever need to enable this again. (If you still need the old, 1.3 version of the source code containing this [commented-out] code, it's HERE. The new source is, as usual, HERE.)



Pre-iOS 4.3 compliance
The new version works just fine under iOS operating systems prior to 4.3. (I've tested it under 4.1, which means it should work on 4.2.1 in the same way.) When running on pre-iOS4.3 OS'es, data rates over 1.75 Mbps are also enabled (and work / can be played back on the device) just fine.

Unfortunately, the 10/14 min/max frame rate setting doesn't help Full sensor mode – it'll “click” with the same frequency as with the default (15/30) setting.

Interestingly, these iOS versions don't seem to take the Preview size paramter into account: no matter what values you provide the system, it'll always work, even when passing extreme values (e.g., 0 for both dimensions). As opposed to 4.3.x.

Finally, I couldn't find a way to completely disable preview in Full sensor mode in order to get rid of “clicking” in the same way as under 4.3 on the expense of focusing to near objects and having live view. This means flawless (if you don't count in the just-mentioned problems) full sensor recording is only available under 4.3.x but not under previous OS versions, where occasional clicking will always take place.
 

Master your iPhone in one minute a day: Sign up here to get our FREE Tip of the Day delivered right to your inbox.

Author Details

Author Details

Werner Ruotsalainen

<p>Werner Ruotsalainen is an iOS and Java programming lecturer who is well-versed in programming, hacking, operating systems, and programming languages. Werner tries to generate unique articles on subjects not widely discussed. Some of his articles are highly technical and are intended for other programmers and coders.</p>
<p>Werner also is interested in photography and videography. He is a frequent contributor to not only mobile and computing publications, but also photo and video forums. He loves swimming, skiing, going to the gym, and using his iPads. English is one of several languages he speaks.</p>