Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
My N41 iPhone 5 (AT&T black) also crashes whenever I hit the go button. I added the write permissions as outlined above, with no change.
 
Thanks all N41 folks.

I've also played with the N42 vs. N41 question and found out that one can just rename the directory on an N42 device to N41 (in iFile, tap the arrow on the right side of N42 and in the uppermost "Name" field, change the name). The Camera app, along with CameraTweak, will work just fine with the new configuration - it seems the OS automatically searches both directories. This is why my N42 model worked just fine after renaming the directory to N41.

After my renaming N42 to N41, my tweak indeed crashes. I'll try to find out why this is the case. (Unfortunately, as long as I need to use a third-party, external tool like SBSettings, it's even harder to track down bugs like this. Hope I'll be directly able to overwrite files in the future. I wish the developer of iFile published how root access can be gained from a JB app.)

In the meantime, if you aren't afraid of it, you can just do the opposite of what I did: simply rename the N41 directory to N42. It should work - at least it did when I did the N42 -> N41 renaming. You'll be able to rename back the directory any time, should you encounter problems. (You may want to make a complete backup of the directory first, though.)

Please keep me posted.
 
In the meantime, if you aren't afraid of it, you can just do the opposite of what I did: simply rename the N41 directory to N42. It should work - at least it did when I did the N42 -> N41 renaming. You'll be able to rename back the directory any time, should you encounter problems. (You may want to make a complete backup of the directory first, though.)

Please keep me posted.
Okay, I renamed my N41 folder to N42. Camera app still opens and takes pictures and videos fine. Opened iP5 VCam+ and selected wide, full sensor/full/NR:ON and clicked Go. I do see the message to say system file updated. Killed Camera app and opened it up. Videos still record at 1920x1080, not at full frame. But when I check my AVCap file, the system date hasn't changed to indicate it was edited.
 
Okay, I renamed my N41 folder to N42. Camera app still opens and takes pictures and videos fine. Opened iP5 VCam+ and selected wide, full sensor/full/NR:ON and clicked Go. I do see the message to say system file updated. Killed Camera app and opened it up. Videos still record at 1920x1080, not at full frame. But when I check my AVCap file, the system date hasn't changed to indicate it was edited.

Strange - this means the SBSettings script hasn't been executed or failed to execute. (Now, I DO wish the dev of iFile (or anyone else) published how he's able to gain root access... I wouldn't need to rely on third-party apps to overwrite files.)

What happens if you manually overwrite the /System/Library/Frameworks/MediaToolbox.framework/N42/AVCaptureSession.plist file with the one (the temporary, generated file) at /var/mobile/Library/ip5-VideoCameraPlus ? iFile will be able to overwrite the former just fine (just delete the original before pasting the latter to /System/Library/Frameworks/MediaToolbox.framework/N42/)? Are the new settings visible?

(Sorry for my not being able to test anything AT&T-related: I'm in Europe. )
 
Okay, overwriting with the temporary didn't make a difference. But renaming the folder back to N41 with the altered file and it does indeed shoot full frame. What should the resolution of the video be? Mine was 1664x1248 with bitrate of 5.57mbits/sec. But the low difference is huge. Unfortunately since the toggle isn't working, I'm going to have to restore to stock values for now.
 
Okay, overwriting with the temporary didn't make a difference. But renaming the folder back to N41 with the altered file and it does indeed shoot full frame. What should the resolution of the video be? Mine was 1664x1248

Yup, that's it. (The maximal resolution the on-chip H.264 encoder can encode in 4:3 mode.)


But the low difference is huge.

Low-light performance?

Unfortunately since the toggle isn't working, I'm going to have to restore to stock values for now.

Remember: after even manually editing / replacing the plist file, you can always easily switch back to stock 1080p (or any other resolution) via CameraTweak.
 
Well don't currently have cameratweak. Will have to see if worth getting it.
 
6.1.2 results

1, the modded plist file works just OK under 6.1.2

2, the tweak, however, doesn't - it seems SBSettings just doesn't execute the script file, which should copy the modified file to /System/Library/Frameworks/MediaToolbox.framework/N4X.

The script, however, works just fine when executed from the SSH command line (as "/var/mobile/Library/SBSettings/Commands/com.menneisyys.ip5camenhancer.movefile") - it nicely overwrites /System/Library/Frameworks/MediaToolbox.framework/N42/AVCaptureSession.plist with /var/mobile/Library/ip5-VideoCameraPlus/AVCaptureSession.plist

All in all, SBSettings's script execution seems to be just broken.

Until I get it working (or find another way of issuing root commands from Cydia tweaks), I recommend CameraTweak to quickly switch between the "hacked" (low-fps but high-res and widest-FoV) and the stock video modes. You don't even need to install SBSettings / my tweak utility to do this.

EDIT: (later): this post, fortunately, is no longer topical.
 
Last edited:
It's working at last!

I've found out simply changing the file owner (and explicitly deleting the target file before calling [NSData writeToFile]) works.

Now, everything works just great on my 6.1.2 N42 device (and should also work on N41 ones - please report back!).

The directly deployable DEB file is at https://dl.dropbox.com/u/81986513/022013/ip5videocamerahack/iP5VCamEnhIOS6.deb , while the latest sources (the only changes are at the end of SystemPlistContentWrapper.m - it deletes "fullSystemPlistPath" and, then, calls [NSData writeToFile]) at https://dl.dropbox.com/u/81986513/022013/ip5videocamerahack/iP5VidCamEnhancer - work.zip

I've added changing the owner to "mobile" to the Debian preinst file:

chown mobile /System/Library/Frameworks/MediaToolbox.framework/N42/AVCaptureSession.plist

and added back write access for all to the enclosing directory (teh same isn't needed for the plist file itself now that its owner is changed to "mobile"):

chmod o+w /System/Library/Frameworks/MediaToolbox.framework/N42/

With these changes, SBSettings is no longer needed and everything seems to be OK.

Please report back!
 
Here's my question. Can you write a tweak which utilises most of the camera's sensor, but keeps the video at standard 23.98?
 
Here's my question. Can you write a tweak which utilises most of the camera's sensor, but keeps the video at standard 23.98?

I'll play with line skipping. Based on my iPhone 4 experience (back in 2011), it won't really work - the resulting true resolution (no matter what target file resolution I used) was very bad. The situation might be the same here on the iPhone 5.
 
I'll play with line skipping. Based on my iPhone 4 experience (back in 2011), it won't really work - the resulting true resolution (no matter what target file resolution I used) was very bad. The situation might be the same here on the iPhone 5.

Wow thanks for the quick reply. I'm a little hesitant to use this as I know 20fps is essentially the edge of "not seamless" video. 23.98 would be quite awesome if it's doable. Thanks for all the work you've put into this
 
Wow thanks for the quick reply. I'm a little hesitant to use this as I know 20fps is essentially the edge of "not seamless" video. 23.98 would be quite awesome if it's doable. Thanks for all the work you've put into this

If you need wide FoV AND a good framerate, your only choice is using the stock VGA mode (640*480), available via CameraTweak or numerous third-party appstore recorders. (I, myself, would stick with CameraTweak.)

My tweak is only for people that don't mind the low frame rate but need as wide FoV as possible AND as good true resolution as possible. This mode can be excellently utilized at, say, videoing conferences, where e.g. the stock VGA mode just wouldn't be high-resolution enough and the stock 720p/1080p would deliver just too dark results (worse low-light performance) or wouldn't have sufficiently wide FoV.
 
If you need wide FoV AND a good framerate, your only choice is using the stock VGA mode (640*480), available via CameraTweak or numerous third-party appstore recorders. (I, myself, would stick with CameraTweak.)

My tweak is only for people that don't mind the low frame rate but need as wide FoV as possible AND as good true resolution as possible. This mode can be excellently utilized at, say, videoing conferences, where e.g. the stock VGA mode just wouldn't be high-resolution enough and the stock 720p/1080p would deliver just too dark results (worse low-light performance) or wouldn't have sufficiently wide FoV.

How do you think this would perform at concerts? Indoors, low light
 
I've run several fps tests today to find out the effects of the different settings on the resulting framerate - all in full sensor mode, of course.

The results are as follows: never EVER enable noise reduction if you want tolerable (20 fps) framerates. That is, make sure the switch I've annotated in the following screenshot remains "OFF":

ip5-vidcamenh-NRswitch.PNG


By keeping this in mind, you can shoot pretty tolerable wideangle, high-resolution 4:3 footage without having to use low-res modes (it's 4:3 modes up to and including 640*480 that provide almost as wide wideangle as my custom mode) or an external add-on lens. For pretty much static family meetings etc, it's sufficient - but, of course, not for action / sports shots.

Note: The framerate doesn't depend on the target encoding bitrate - it has absolutely no effect on the actual encoding framerate. It'll be the same if you select full / half/ quarter / whatever target encoding bitrates.
 
Persisting problems for N41

I've found out simply changing the file owner (and explicitly deleting the target file before calling [NSData writeToFile]) works.

Now, everything works just great on my 6.1.2 N42 device (and should also work on N41 ones - please report back!).

The directly deployable DEB file is at https://dl.dropbox.com/u/81986513/022013/ip5videocamerahack/iP5VCamEnhIOS6.deb , while the latest sources (the only changes are at the end of SystemPlistContentWrapper.m - it deletes "fullSystemPlistPath" and, then, calls [NSData writeToFile]) at https://dl.dropbox.com/u/81986513/022013/ip5videocamerahack/iP5VidCamEnhancer - work.zip

I've added changing the owner to "mobile" to the Debian preinst file:

chown mobile /System/Library/Frameworks/MediaToolbox.framework/N42/AVCaptureSession.plist

and added back write access for all to the enclosing directory (teh same isn't needed for the plist file itself now that its owner is changed to "mobile"):

chmod o+w /System/Library/Frameworks/MediaToolbox.framework/N42/

With these changes, SBSettings is no longer needed and everything seems to be OK.

Please report back!

First, I just wanted to thank you for all of your great work on this tweak.
Reporting back, the only problem is that it still is not compatible with my iPhone 5 6.1.2 N41 device. However, I did find a ghetto-rigged solution which makes your app fully functional.
When I first installed iP5 Vcam+, it would crash whenever I hit "Go," so I read the rest of your posts, I renamed the N41 directort to N42, which prevented your app from crashing, but failed to change the camera's settings even after killing Camera.

My solution, which makes it work 100%, was to duplicate the N41 folder, and name it N42, so I had both N41 and N42 in the same directory. I then created a symlink from "./N42/AVCaptureSession.plist" and placed the symlink in "./N41/", overwriting the original plist in N41. Now the tweak works flawlessly.

Bottom line: there are still compatibility issues with N41 devices, but it is a relatively easy fix.

Edit: Did you possibly forget to add the new chmod and chown commands to the preinst file for N41?
 
Last edited:
First, I just wanted to thank you for all of your great work on this tweak.

Thanks!

Now that I've found out why some of my recordings dropped so many frames (I've switched on the "NR" switch), I proceed to cleaning up the entire app, and, most importantly, the Advanced tab. Then, it'll be very easy to quickly switch between any kind of configuration (different resolutions, bitrates, NR / binding configs etc.) anyone can easily modify / customize.

Edit: Did you possibly forget to add the new chmod and chown commands to the preinst file for N41?

They surely are in the preinst file (btw, it can easily be checked by just unpacking the DEBIAN subdirectory of the DEB file with the command "pkg-deb-fat -e iP5VCamEnhIOS6.deb"):

if [ -d /System/Library/Frameworks/MediaToolbox.framework/N41/ ]; then
chown mobile /System/Library/Frameworks/MediaToolbox.framework/N41/AVCaptureSession.plist
chmod o+w /System/Library/Frameworks/MediaToolbox.framework/N41/
fi

It should work. This is why I don't understand why it doesn't.
 
Werner,

Thanks for all our hard work and answers to questions so far. I have a question.

In iOS 6.x.x, What is the highest possible resolution you can achieve with a 4:3 ratio and at 30fps?
 
Werner,

Thanks for all our hard work and answers to questions so far. I have a question.

In iOS 6.x.x, What is the highest possible resolution you can achieve with a 4:3 ratio and at 30fps?

IIRC, all my attempts at utilizing vertically more than 1080 pixels failed while NOT oversampling the entire sensor, that is, when tying to keep the framerate at 30 fps. I can't test it as I've lost my iPhone 5 jailbreak (the battery died and the entire phone was exchanged. The new phone came with 6.1.4. Every cloud has a silver lining, though: now, I can test iOS7's camera enhancements. My first report has already been published at https://forums.macrumors.com/threads/1600113/ )

However! You can give it a try, by directly editing the plist file, if you keep the following in mind:

- the H.264 encoder can encode video of arbitrary (!) aspect ratio if any only if the total number of pixels is under roughly 2.08 Million. This is why I had to use the resolution 1664*1248 with 4:3. (2076672 pixels) - a slightly larger encoding resolution would have failed. For example, this is why 1668*1251 (2086668 pixels) generates an invalid video file.

The default 1920*1080 mode has 2073600 pixels - slightly less than my custom mode.

- that is, if you do increase the number of encoded vertical pixels, you must decrease the horizontal ones to stay in the 2.08 Million.
 
The tweak installs (and, during installing, correctly sets the access flags on /System/Library/Frameworks/MediaToolbox.framework/N42/ and /System/Library/Frameworks/MediaToolbox.framework/N42/AVCaptureSession.plist) but crashes upon starting under iOS7.

I'll try to come up with an iOS7-compliant version.
 
Guys,

I have some good news: iOS7 supports my hack.

Basically, if you want to manually edit the /System/Library/Frameworks/MediaToolbox.framework/N42/AVCaptureSession.plist file (it's easier than you may think!) on either the

- desktop (with either Xcode or BBEdit)
- iPhone (via the property list editor of iFile)

all you need to do is modifying AVCaptureSessionPreset1920x1080 and not AVCaptureSessionPresetHigh. Everything else is the same – unlike with the iOS5 → 6 switch, there aren't major changes. (More on them, for advanced hackers only, below.)

I've also provided a wideangle example file with half the data rate (8500000 bps) at https://dl.dropboxusercontent.com/u...iew/AVCaptureSession -1:2speed and wide.plist . Make sure you rename it to AVCaptureSession.plist before deployment and also kill the camera app so that the changes are seen.

What about my Cydia tweak, updated to iOS7?

I'm travelling and have restricted tools here, meaning it'd take me a lot of time to compile a .deb. I'll create it after 05/Jan, after returning home from travelling.

Advanced stuff (geeks only!)

The main changes between iOS6 and 7 are as follows:

AVCaptureSessionPresetHigh no longer has an entire subrecord with all the capturing, previewing and encoding parameters inside, but just a reference to the highest-resolution mode, that is, AVCaptureSessionPreset1920x1080. This is why my iOS6-specific tool crashes right at startup – after all, it tries to access something (entries under AVCaptureSessionPresetHigh) not existing any more.

Other notable differences:

- on the top level of the tree, instead of just one, there are two dictionary entries: in addition to the traditional AVCaptureDevices, also AVH264Settings. The latter, now, describes the maximal resolution of 16:9 and 4:3 AVCHD encoding: 1920 and 1664, respectively. (Where's 1664 from, you may ask. I've explained it in my original post https://forums.macrumors.com/threads/1538193/ )
- no AVCaptureSessionPreset1280x720p60 at all (not that it would have worked under iOS6...) - now, 30+p modes can easily be set from your app via setting the property activeVideoMaxFrameDuration – see https://forums.macrumors.com/threads/1602171/
- AVCaptureSessionPresetX/VideoCompressionProperties no longer has the entries MaxKeyFrameIntervalDuration and Priority. These have been made common to all presets by having been relocated to the brand new VideoCompressionProperties dictionary under AVCaptureSessionPresetCommon
- iOS7-only features are also added; for example, smoothAutoFocusSupported and videoZoomSupported.

Hacking the brand new AVH264Settings

As has already been mentioned in the first bullet above, the maximal resolution is defined in the brand new, top-level AVH264Settings directory entry.

Unfortunately, hacking its values still doesn't allow for going over the 2 Mpixel limit (that of Full HD in 16:9 and 1664*1248 in my full-sensor, oversampled 4:3 mode). That is, it's not worth bothering with raising these new AVH264Settings values to try to achieve, say, 2k (2048 pixel wide) recording in 16:9 or larger-than-1664*1248 in my tweaked mode. I've even provided a(n, again, non-working!) plist file demonstrating this at https://dl.dropboxusercontent.com/u...View/AVCaptureSession-2ktest-NOTWORKING.plist
 
@Menneisyys2

This is some pretty cool stuff! Thanks for all your work figuring out and developing it! I was wondering, is there any way of enhancing the "burst mode" feature of the iOS 7 camera (especially for devices below the 5s)? Any way to make it take faster pictures (more per sec) when the shutter button is held down (without sacrificing resolution)? I know there are some legitimate apps that can do this (like SnappyCam, which is capable of 20 FULL SENSOR 8Mpx pics/sec on the iPhone 5), but it would be cool to have it built into the "stock" camera app.

Keep up the good work and thanks again!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.