iPhone Much better low-light performance & wider field-of-view for iPhone 4/4S/5/5s, iPad3/4

Discussion in 'Jailbreaks and iOS Hacks' started by Menneisyys2, Feb 5, 2013.

  1. Menneisyys2, Feb 5, 2013
    Last edited: Jun 24, 2014

    Menneisyys2 macrumors 603

    Jun 7, 2011
    UPDATE (Jun/24/2014): the current (1.6) version is fully compatible with iOS 7.1.1.

    UPDATE (Mar/31/2014): at http://forums.macrumors.com/showpost.php?p=18943554&postcount=303 and http://forums.macrumors.com/showpost.php?p=18945661&postcount=304 , I explained iOS can't "bump" the ISO sensitivity to allow for higher framerates in low light on the 5s while shooting video in my tweaked mode. This is certainly bad news.

    UPDATE (Feb/24/2014): version 1.5 out in my Cydia repo. It kills the Camera app when you save the new configuration. You no longer need to do this manually. This is a MAJOR new feature. More info & source & direct DEB links: http://forums.macrumors.com/showpost.php?p=18810817&postcount=286

    UPDATE (Jan/20/2014 0:20 GMT): full iPhone 3GS support added. The one you'll want to choose depends on the iOS version,

    - iOS 4.0...4.2.x: http://forums.macrumors.com/showpost.php?p=18658177&postcount=245
    - iOS 4.3.x: http://forums.macrumors.com/showpost.php?p=18662073&postcount=246
    - iOS 5.x: http://forums.macrumors.com/showpost.php?p=18663358&postcount=247
    - iOS 6.x: the Universal version (see the last update) has been updated to version 1.1 and now supports the 3GS under iOS6 as well (see http://forums.macrumors.com/showpost.php?p=18640187&postcount=238 )

    UPDATE (Jan/14/2014 20:27 GMT): Universal version released! http://forums.macrumors.com/showpost.php?p=18640187&postcount=238

    UPDATE (Jan/09/2014 21:57 GMT): iPad 3 support added. See http://forums.macrumors.com/showpost.php?p=18618587&postcount=209

    UPDATE (Jan/09/2014 13:27 GMT): iPhone 4 and iPad 4 support added. See http://forums.macrumors.com/showpost.php?p=18615796&postcount=206

    UPDATE (Jan/04/2014 10:27 GMT): I've cleaned up and streamlined my Cydia repo so that you can quickly find the version you'll need (AT&T vs. rest; iPhone 5 vs. 5s). NOTE: trying to install the wrong version is safe as the installation will simply fail.

    In the screenshot below, I've annotated the two times two tweaks:


    UPDATE (Jan/04/2014 08:17 GMT): iPhone 5 + AT&T version (the one with the N41 directory) out: https://dl.dropboxusercontent.com/u...5videocameraenhancer7att_1.0_iphoneos-arm.deb (see THIS).

    UPDATE (Jan/03/2014 09:37 GMT):
    I've released an iPhone 5s-specific version for non-AT&T handsets too; that is, for ones with "N53" directories. See http://forums.macrumors.com/showpost.php?p=18584645&postcount=168

    Note that the latest versions of tools, for both the iPhone 5 and 5s, fail to install on devices with the wrong folder. Then, you'll see a "256" error message like the one at http://forums.macrumors.com/showpost.php?p=18579481&postcount=150 during installation. That is, installing the wrong one on your iPhone 5s shouldn't cause any problem - if one of the two versions fails to install, give a try to the other one.

    UPDATE (Jan/02/2014 20:07 GMT):

    Uploaded the latest two (iPhone 5 and 5s) DEB's to my private Cydia repo at http://winmobiletech.com/cy . They're at the bottom of the following screenshot:


    UPDATE (Jan/02/2014 13:57 GMT):

    New version: refreshing the SpringBoard after installation so that you don't need to respring to make the icon of my app shown. (More info.)

    iPhone 5 (not for AT&T devices! They still require manual hacking!): https://dl.dropboxusercontent.com/u/81986513/012014/02-camhack/ip5-vidcamenh-20140102-01.deb

    iPhone 5s: https://dl.dropboxusercontent.com/u/81986513/012014/02-camhack/ip5s-vidcamenh-20140102-01.deb

    UPDATE (Jan/01/2014 23:27 GMT): I've completely reworked the app: I've cleaned and bugfixed it up fully and removed everything useless / non-iOS7-compliant.

    Links to the new versions:
    https://dl.dropboxusercontent.com/u/81986513/012014/01-camhack/ip5-vidcamenh-20140101-08.deb (non-AT&T iPhone 5)
    https://dl.dropboxusercontent.com/u/81986513/012014/01-camhack/ip5s-vidcamenh-20140101-01.deb (iPhone 5s)

    Consult http://forums.macrumors.com/showpost.php?p=18577965&postcount=147 for more info.

    UPDATE (Dec/31/2013 8:57AM GMT): forum member "nheilweil" has provided us (link; my answer) with an excellent comparison of the low-light performance of my tweaked mode, compared to that of Apple:


    (flickr link)

    Upper is the default Apple mode, lower is that of mine

    Notice how immensely better low-light performance my tweaked mode has! Also notice the significantly wider field-of-view of my mode. These are the two main advantages of using my tweak.

    UPDATE (Dec/31/2013 6:10AM GMT): the iPhone 5s version (links: DEB file; sources) works just great! (At least on AT&T handsets, which have an N51 directory. I don't know about international GSM ones, which may have a differently named directory. With them, the app will not work. Let me know if it doesn't work with your handset!)

    It consistently produces 30p upsampled video at full resolution - with, as with upsampled videos in general, excellent resolution and low-light performance. No previous, HD / Full HD-capable iPhone was capable of such a feat - they've all (4, 4S, 5, 5c) topped at around 19 fps, making my app useless for, say, sports shooting. Just don't forget there's no image stabilization (as it uses the entire sensor surface), meaning you will want to prefer shooting on a tripod, unlike with the stock implementation.

    You might want to take a look at the video samples HERE. (Thanks for forum member WAM2 for testing / uploading this test video! )

    As usual, follow THIS quick guide if you don't know how DEB files should be installed.

    UPDATE (Dec/30/2013 7:50PM GMT):

    1. I've just released a preliminary iPhone 5s version - see THIS for the DEB file / sources (and the warnings).

    2. Note that AT&T iPhone 5 iOS7 devices still don't work with the original (see the Dec/25/2013 update below) DEB file - just like under iOS6. With them, you need to use THIS workaround (also stated to work HERE).

    3. I don't know why and how everything I posted in this OP prior to Feb/07/2013 has been removed. The original article is HERE.

    NOTE: below, I only discuss the iPhone 5-specific version, not the 5s one.

    UPDATE (Dec/25/2013 3:20PM GMT): I've just released the iOS7-compliant app for end users (along with full sources). Download links & explanation: http://forums.macrumors.com/showpost.php?p=18547175&postcount=102

    UPDATE (Dec/24/2013 8:52PM GMT): check http://forums.macrumors.com/showpost.php?p=18544937&postcount=99 for iOS7 compatibility updates.

    UPDATE (Apr/13/2013 8:46PM GMT): keep the "NR" switch switched off for the best possible framerate in full sensor mode. See http://forums.macrumors.com/showpost.php?p=17139035&postcount=92

    UPDATE (Feb/21/2013 8:46AM GMT): everything is OK with the latest version (under 6.1.2), see http://forums.macrumors.com/showpost.php?p=16882020&postcount=85

    UPDATE (Feb/19/2013 5:19AM GMT): it seems the previously released supposedly N41-compliant (that is, one for AT&T users) version wasn't compatible with N41, after all.

    At http://forums.macrumors.com/showpost.php?p=16869739&postcount=78 , I've outlined another way of battling this problem.

    UPDATE (Feb/17/2013 11:53AM GMT): New version released, with a new URL. This version also supports iPhone 5 models with "N41" directories (not only "N42") and is somewhat cleaned up / changed to show it's meant for iPhone 5's. More info at http://forums.macrumors.com/showpost.php?p=16860707&postcount=62

    UPDATE (Feb/07/2013 11:20AM GMT): New version out with fixed bitrate setter: http://forums.macrumors.com/showpost.php?p=16804056&postcount=26 . The post also explains how it needs to be used together with CameraTweak, should you want to use it on top of my hacks, let them be the static plist file or the full suite of the DEB tweaker. (Again, I really recommend CameraTweak, it enhances my tweaks really well providing just the functionality that is missing from my tweak - and vice versa, my tweak offers what is missing from CameraTweak, that is, support for the entire sensor area and settable recording video bitrates.)

    UPDATE (Feb/07/2013 10:20AM GMT): posted a long CameraTweak compatibility report to http://forums.macrumors.com/showpost.php?p=16803941&postcount=25 . It's REALLY worth reading as if you have / purchase CameraTweak (which I really recommend), it can switch between my tweaked full sensor mode and the stock configuration even without having to install my tweaker utility (and SBSettings). Then, however, you'll also lose

    (Was: "Enhancing the iOS6/7 iPhone 5 video camera - iPhone 5s-specific version added!")
  2. LoneWolf121188 macrumors 6502a

    Jun 7, 2007
    Longmont, CO
    Wow, very cool! So basically you've set it to record about twenty 8MP frames per second instead of sixty 2MP frames per second (1080p)? I'm surprised you can change that with just a quick plist edit!
  3. Menneisyys2 thread starter macrumors 603

    Jun 7, 2011
    1, if you create a H.264 video of it, then, you have to live with the size restrictions of the H.264 encoder - it's that that requires one to use 1664x1248 (slightly over 2 Mpixels) instead of the original size.

    2, it MAY be possible to record 20 8 Mpixel images as standalone still shots as opposed to H.264 video (haven't tested this) - hope the I/O bandwidth, the storage etc. can keep up with, say, 60-90 Mbytes a second. At least this might be the reason for the same .plist file's having AVCaptureDevices / 0 / AVCaptureSessionPresetPhoto / LiveSourceOptions / MinFrameRate = 15 and MaxFrameRate = 20.
  4. Hitrate macrumors 6502


    Mar 25, 2009
    Sweet! Can't wait for the iPhone 5 version, please beam me when it's ready :D
  5. y0m0uth macrumors regular

    Dec 29, 2008
    can you make this a downloadable tweak for us noobs?
  6. kalirob99 macrumors 68000


    Dec 24, 2008
  7. Menneisyys2 thread starter macrumors 603

    Jun 7, 2011
    Will do ASAP.
  8. Adutrumque macrumors 65816


    Mar 8, 2012
    I'm gonna try this!
    Will iFile trial unlimited let me go in there?
  9. Menneisyys2 thread starter macrumors 603

    Jun 7, 2011
    I think so - I mean it has the Wi-Fi server enabled even in the trial. (Can't test as I've purchased it and it automatically validates itself.)
  10. Norinion macrumors regular

    Oct 18, 2010
    Wow, will keep a tab on this for updates. Amazing read.
    If you do do a tweak for us noobs, please, if you can, include a toggle, to turn on and off depending on the event. This is an amazing find.
  11. Adutrumque macrumors 65816


    Mar 8, 2012
    Isn't it permament after this tut?

    As to whether a toggle should exist I don't think so. The pic after this tut is MUCH better in comparison and I wouldn't want to return to "standard mode".

    So in conclusion, if I do this I want it to be permament.
  12. Menneisyys2 thread starter macrumors 603

    Jun 7, 2011
    I'll release the installable / executable DEB installer today - I'm already testing a beta. It, as with my past enhancer tools, exactly do what you've asked for :)


    1. Nope, you can always reload the old plist file and restore the default 1080p mode.

    2. Unfortunately, this hack decreases the frame rate from 30 to 19.5. That is, it's not suited for shooting, say, sports events.
  13. Menneisyys2 thread starter macrumors 603

    Jun 7, 2011
    So far, everything is working great with my beta tool. DEB release today; sources will be released even earlier so that, assuming you set the file writable settings yourself, anyone with a dev account can play with the hack.
  14. Hitrate macrumors 6502


    Mar 25, 2009
    Will it work in conjunction with CameraTweak ? Which btw. has the option of 60fps video. But from what I can gather, that is not what it's doing on ip5 ios 6.1 jb, so I guess the option is there for older devices, and not turned off for this one, so it's a nice but unusable gimmick..
  15. tateu macrumors 6502

    Jan 27, 2012
    I might have kept my 4s on IOS 5.1.1 if I had known I would lose 720p at 60fps. Oh well.
  16. Menneisyys2, Feb 6, 2013
    Last edited: Feb 6, 2013

    Menneisyys2 thread starter macrumors 603

    Jun 7, 2011
    1. 60 fps seems to be impossible under 6.1 ATM on both JB'n and non-JB'n devices.

    2. I'll test interoperability / conformance with CameraTweak. Basically, the two tools / hacks are meant for completely unrelated things: mine is for allowing for using the entire sensor surface + switching between different bitrates + user-defined presets; CameraTweak is for fps & resolution changing and other niceties but not for using the entire sensor.
  17. Menneisyys2 thread starter macrumors 603

    Jun 7, 2011
    Huh.. this was a tough call... at the end, I had to make use of SBSettings' new external function call (see "Calling external functions and scripts from within your toggle." at http://thebigboss.org/guides-iphone-ipod-ipad/sbsettings-toggle-spec ) because, for some reason, under iOS 6, this directory ( /System/Library/Frameworks/MediaToolbox.framework/N42 ) just can't be accessed for overwriting from, otherwise, Cydia-installed apps (I'm not speaking about Xcode-deployed ones - see THIS for the difference if interested), unlike under previous iOS versions. This has caused me a LOT of headache and a LOT of wasted time.

    Fortunately, this all didn't result in the end users' having to do any kind of file-level permission granting / owner changing via iFile or OpenSSH. (BTW, I couldn't even install the latter on the iPhone 5 - did anyone succeed?) All you'll need to do is installing SBSettings before downloading and installing my DEB file and, then, completely rebooting the phone. (Sorry, not my fault: SBSettings requires its sbsettingsd to be killed and restarted in order to notice new, user-added scripts.)

    Now that it's at last working without having to manually hack anything (other than transferring the DEB file to the iPhone and execute it from iFile), I will now tidy up the source and and release the DEB. Hope in an hour.
  18. Norinion macrumors regular

    Oct 18, 2010
    Oh man, am excited. What is the tweak called? or are you releasing the DEB straight on the forum?

    Also a second question. Since there's 2 options either 2MP on 60 fps, or 8MP on 20 fps, is there anything in between? For example 5MP on a higher fps setting?
  19. Menneisyys2 thread starter macrumors 603

    Jun 7, 2011
    Yup, straight to the forum. I hate early Cydia releases as, at least at first when I keep releasing refined versions on sometimes an hourly basis, I would end up having to do a lot of paperwork to properly signal updates to Cydia so that it notices the package being changed.

    Just creating a DEB file out of my scripts and compiled sources, on the other hand, is just one command.

    When I stop refining the app, I'll also release it in Cydia.

    1. Nope, there's no 60 fps option at all - it seems it's impossible under iOS 6 (as opposed to iOS 5 on the 4S). My tweak "only" allows for making use of the entire sensor area for hugely widened field-of-view and enhanced low-light performance (with some frame rate hit). (And allows for also setting the bitrate and some other params like binning or noise reduction. The two latter doesn't seem to have any effect in full-sensor mode.)

    2. At least based on my previous experiments with the iPhone 4 / 4S, you either use the full sensor or just 1920*1080 pixels. If you specify a sensor area just slightly smaller than the physical pixel count under AVCaptureDevices / 0 / AVCaptureSessionPresetHigh / LiveSourceOptions / Sensor, the results will be awful (low-res cr@p). (Again, the iP5 may be different in this case. I'll test it when I have some time.)
  20. 0000757 macrumors 68040

    Dec 16, 2011
    Wait, slightly confused here, if there's no 60fps, then what does the iPhone (4S in question, since that's what I have) natively shoot, since I was under the assumption it was 60fps? Or are you saying you just can't get the tweak to run at 60fps.

    If the answer is you can't get the tweak to run at 60fps and the iPhone can do 60fps, are you saying the tweak will limit native 60fps @ 2MP?

    Would you create an app interface to allow say a switch/toggle to change between stock and modified or would it be a install/uninstall basis?
  21. Menneisyys2, Feb 6, 2013
    Last edited: Feb 6, 2013

    Menneisyys2 thread starter macrumors 603

    Jun 7, 2011

    here's the first public version. HERE is the DEB file (install it via iFile after transferring it to your iPhone 5) and HERE are the sources if you want to take a look at them. Note that

    - you MUST install SBSettings from Cydia before installing this app (see THIS for the reason) and

    - restart the phone (respringing won't suffice!) after installing this tweak so that SBSettings recognizes the new copy script. It's, BTW, com.menneisyys.ip5camenhancer.movefile inside the app bundle and is automatically installed by the postinst debian script (as is recommended for example HERE - see Nate's post at Aug 11 '12 at 23:35). All it does is copying the app-generated plist file from a temp directory to the target one (mv /var/mobile/Library/ip4-VideoCameraPlus/AVCaptureSession.plist /System/Library/Frameworks/MediaToolbox.framework/N42/). I needed to resort to this as, as has been explained above, under iOS6, it seems DEB-based apps don't have write / file creation / overwrite access to anything under /System/Library/Frameworks/MediaToolbox.framework/N42 (interestingly, file deletion works), not even after making it o+w in the debian preinst file.

    - install the DEB file as is explained in my previous, iPhone 3gs / 4-specific tutorials (from iFile - download it from Cydia too!)

    - make absolutely, dead sure you back up /System/Library/Frameworks/MediaToolbox.framework/N42/AVCaptureSession.plist before starting the app. The app WILL crash from time to time (I think it's related to invoking the external SBSettings) and will delete the AVCaptureSession.plist file, rendering the camera useless. I'll reimplement the in-app plist restoration feature in the app (it was present back in the iOS 4 days for the iPhone 3GS and 4). Now, the only way to reenable the camera is restoring the file. The latter can also be done via iFile using a local plist backup (that is, you can restore right on your iPhone, without using any desktop) – but strictly manually. If you're unsure about this, do NOT use the tweak yet. Automatic restoration (if I can't figure out why the SBSettings invocation is crashing) will be very soon implemented.

    - before (or after) every change in the tool, kill the camera (in the taskbar) so that it sees the changes. (As was the case with previous versions.)

    - For the time being, keep Binned always off and Noise Reduction on (the two switches at the top of the default Simple view tab). The latter has a positive effect, while enabling the former may result in completely useless footage. (Basically, I've implemented the Binned checkbox for the 4S' 720p recording mode. When I add selectable 720p recording, Binned mode will be usable, I think – at least, again, it was on the 4S when one needed absolutely good low-light performance and could put up with the decreased resolution.)

    - The “Advanced view” (the second tab) has not been updated for the iPhone 5 (it has iPhone 4-specific values). Don't modify / save any list entry in it!

    - After selecting the sensor usage mode (default vs. wide) and possibly the bitrate, tap “Go”. If the app immediately crashes, restore AVCaptureSession.plist manually (see above). Otherwise, if a confirmation dialog is shown, you can start the stock Camera app right away and start shooting with the new settings.


    The 4S has always been 30 fps. There's a (restricted, 720p-only and, on top of that, and halved-resolution) 60 fps mode but it can only be used under iOS 5. There's no known way of using it under iOS6, not even when jailbroken.

    Yup, my app is a toggle directly modding the plist file to avoid having to always manually copy modded plist files when wanting to switch between different configs.

    UPDATE (some minutes later): the crashing problem has been fixed and the new version released, see http://forums.macrumors.com/showpost.php?p=16801936&postcount=22
  22. Menneisyys2 thread starter macrumors 603

    Jun 7, 2011
    The problem has been fixed in the version I've just posted (the URL's are the same).

    If you've already checked out the sources / the SBSettings file, here's the change: I've moved the plist deletion from the Obj-C app to the script. (This also means the "com.menneisyys.ip5camenhancer.movefile" file has received another command, "rm /System/Library/Frameworks/MediaToolbox.framework/N42/AVCaptureSession.plist
    ") That is, even if the SBSettings call crashes, the file deletion & move operation will be executed atomically, resulting in no loss of the original plist file.

    Nevertheless, do back up the file before starting to use the tweak.
  23. Hitrate macrumors 6502


    Mar 25, 2009
    Two questions: Do I have to be a developer to go ahead and use this deb file in ifile? (I'm not)

    And could this work with NCSettings? I'm liking that better than SBsettings and also it should be lighter in use from what I've read. (Just wanna ask before uninstalling and using SBsetings instead, also I might wait till the official version of your tweak is up)

    Oh and please inform about CameraTweak comparability when u have time to test it, nice to hear it shouldn't interfere.

    Gotta say though, I wanna try this improvement, can hardly wait :D thanks 4 ur work !
  24. moldy lunchbox macrumors 6502a

    Sep 9, 2010
    Raleigh, NC
    This sounds awesome for video. I really need sit down over the weekend and check it out in-depth.
  25. Menneisyys2, Feb 7, 2013
    Last edited: Feb 7, 2013

    Menneisyys2 thread starter macrumors 603

    Jun 7, 2011
    I've very thoroughly tested interoperability with CameraTweak (which, should you not know it, is a GREAT jailbreak tweak MUCH MORE recommended than third-party AppStore apps – see http://forums.macrumors.com/showthread.php?t=1479551 for more info)

    I have VERY good news: my configurator tool works just great with CameraTweak:

    - if you configure your camera to use the entire sensor area in my tool (by selecting “Wide, Full Sensor” in the left list), unless you override the resolution setting in CameraTweak, the latter will apply its additional goodies to the wide setting. That is, you can use the separate exposure / focus carets and frame rate settings (e.g., 1 fps) while still shooting using the entire sensor, making the FoV as wide as possible.

    - if you do override the resolution (by tapping the third icon in CameraTweak), the camera will record in this resolution. Once you disable resolution overriding, my settings will be reapplied without having to reconfigure anything in my tweak and/or shutting down the Camera app.

    The latter also means you don't even need to touch my tweak more than once – or, for that matter, install it at all (assuming you upload the plist file with the full sensor recording area) if you would not use any other feature than switching between the default (1080p), narrow FoV and using the entire sensor area. You configure the Camera app to use the entire sensor (“Wide, Full Sensor” + “Go”) and, whenever you need to switch between the two modes (my full sensor mode and the stock 1080p mode), you just make sure the resolution scroller is on “1080p” and, then, just enable it. Actually, it's much-much faster than exiting (and killing) Camera, starting my configurator, changing the recording mode and, then, restarting Camera.

    Of course, there is stuff CameraTweak isn't capable of; for example, setting the recording bitrate, fine-tuning binned / noise reduction modes or even using user-definable presets (see the Advanced tab, which I'll make iP5-compliant soon).

    All in all, if all you want is switching between the full sensor (=wide FoV) and 1080p mode and already have CameraTweak (if you don't, purchase it, it's a great tweak), you don't need to install my app. Just overwrite the stock /System/Library/Frameworks/MediaToolbox.framework/N42/AVCaptureSession.plist (with, say, iFile's uploading – again, iExplorer does NOT work with this directory (yet?)!) with the one at https://dl.dropbox.com/u/81986513/022013/ip5videocamerahack/enhancedplist/AVCaptureSession.plist (the same as the one listed from my initial post above) and you're all set. Just use the third, resolution icon in CameraTweak to switch between the two configurations. This also means you don't need to install SBSettings for my tweaked plist (but NOT the active tweaker DEB app!) to work, either.

    Known problems

    For some reason, bitrate overriding doesn't seem to work in the current version (the one at https://dl.dropbox.com/u/81986513/022013/ip5videocamerahack/iP4VCamEnhIOS5.deb ). I'm looking into the problem.

    Further development

    Now that I must rely on SBSetting's scripting to access the, compared to pre-iOS6 versions, (further) protected file system, I'll look into process killing features to avoid having to manually shut down the stock Camera app to make it use the changed settings.


    Nope, DEB files can be installed w/o a dev account. I only provide the sources in addition to the DEB file so that anyone can see what the tool contains.

    If all you need is full sensor, then, you don't need to use my tweaker DEB - only the tweaked, static plist file. With CameraTweak, you can easily switch between my tweaked plist and the standard resolutions / configurations. (Then, of course, you lose fine-tuning like binning / noise reduction / bitrate but most of the time you'd only need the ability to switch between the stock video modes and mine and won't lose much by not being able to fine-tune settings.)

    Thanks :)

Share This Page