iPhone The first real iPhone 3GS video camera hack released!

Discussion in 'Jailbreaks and iOS Hacks' started by Menneisyys2, Jun 28, 2011.

  1. Menneisyys2, Jun 28, 2011
    Last edited: Jul 1, 2011

    Menneisyys2 macrumors 603

    Joined:
    Jun 7, 2011
    #1
    4th EDIT (07/02 5:46 CET): In the brand new version in Cydia (1.4), I've implemented a lot of goodies (e.g., re-enabled Full screen mode). See http://www.iphonelife.com/blog/87/n...-video-recorder-enhancer-released-source-code for more info.

    Previous (now-outdated) updates:

    3rd EDIT (07/01 4:16 CET): In the brand new version in Cydia (1.3), I've added full 4.3 support. Please see http://forums.macrumors.com/showpost.php?p=12858321&postcount=20 for a complete writeup.

    Note that the Cydia app has problems with Cydia update notifications (it continuously displays being updated). I'll try to fix this some time so that you don't see that ugly badge on your Springboard.

    Older updates (now that there's full 4.3 support, they're mostly outdated and not topical any more):

    2nd EDIT (06/30 23:11 CET): In the brand new version (1.2),

    - I've added a new button to Simple view to restore the default configuration. You'll want to use it if you're on 4.3.x and want to get rid of the app and restore everything (see http://forums.macrumors.com/showpost.php?p=12856541&postcount=15 ) OR switch back (and forth) between the already working 1080p mode and the system default 480p mode.

    - please see http://forums.macrumors.com/showpost.php?p=12856729&postcount=16 on the latter.

    - fully 4.3.x-compliant version will be released soon; until then, on 4.3.x, ONLY use this app if you ONLY want to use the 1080p mode and NOT the Full mode and put up with the system only being able to play back 1080p videos shot up to 1 Mbps! (These restrictions will hopefully be fixed in the next version.) Note that it's 100% compatible with iOS versions prior to 4.3; if you (still) have one of those OS'es, you'll find the current version excellent. It's only 4.3.x that it's (still) somewhat incompatible with.

    EDIT (06/30, in the morning) (SOMEWHAT OUTDATED UPDATE!): For the time being, only use the hack on pre-4.3 devices, where it works 100%. See http://forums.macrumors.com/showpost.php?p=12854716&postcount=12 for the explanation and for a quick note on restoring factory state, should you already have installed it under 4.3.x.

    Original message:

    I've just released the 3G S version of my previous iPhone 4-only camera hack (see http://forums.macrumors.com/showthread.php?t=1178171 ; please check out the iPhone 4 manual for more info on how the GUI works. The 3G S version is only a bit different from the iPhone4 one, so, your learning curve won't be so steep as when starting from stratch.).

    The tool allows for greatly increasing resolution and fine-tuning data rate (in Simple view) and fine-tune all parameters (in Advanced view).

    As usual, I also provide you with all the sources; see http://dl.dropbox.com/u/13100693/html/062011iPhone3GSCameraHack/iP43GSCamEnhancer.zip

    The directly deployable Cydia package is on the same Cydia repo (http://www.winmobiletech.com/cy or http://winmobiletech.com/cy ). Make sure you download the 3GS-specific one and not the one for the 4.0! (See image below)

    I've directly tested this on my 4.2.1 3G S. I couldn't directly test it on a 4.3+ 3G S. However, exactly the same codebase works just fine on the iPhone 4 4.3.x (where, in general, the only difference is a directory name) with different parameters; therefore, the utility should work on the 3G S 4.3.x too.

    Feedback, bug reports etc. are welcome - and don't forget I'll post a full article, full of test videos and pictures, on what the different parameters do, in 1-2 days! (I just didn't want to wait any more with releasing the app itself before publishing the article. After all, you can use the app even without reading the article.)

    [​IMG]
     
  2. Menneisyys2, Jun 29, 2011
    Last edited: Jun 29, 2011

    Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #2
    Enhancing the video recording quality of the iPhone 3GS - Part I

    The video recorder of the iPhone 3G S can heavily be enhanced. As opposed to the iPhone 4, where the main enhancements are “only” making the field-of-view much wider, the data rate selectable and, with pixel binning, the low-light performance much better (by sacrificing some resolution and speed), the enhancements of the 3G S camera, in addition to the better low-light performance through pixel-binning, are waaaay superior: you can greatly increase the resolution, almost to the level of the iPhone 4 or traditional cameras.

    So far, no one has released any tool that would have made it easy to quickly switch between the different configurations. Sure, there is a Winterboard theme called „HD Video Enabler for 3GS” but, it seems, it doesn't work (see the comments for example HERE, HERE and HERE). It didn't work on my device either. The widely known solutions (e.g., THIS) don't work on 4.3+ either and, of course, they don't offer any kind of quick switching (actually, you even need a desktop computer to even switch! Compare this to the easiness of my switching solution, which only needs the phone itself). Therefore, I took the liberty to make my previous, iPhone 4-specific application support the 3G S too.

    First and foremost, there are two main “enhanced” modes, in addition to the factory VGA (640*480; 480p for short) video recording mode, you'll want to use, both with its own advantages and disadvantages: a mode not utilizing all pixels but still delivering good resolution (the 1080p mode, named after the Sensor setting of 1920*1080) and around 29-30 fps speed and the full pixel-binned mode, which is pretty similar to the “enhanced” mode of the iPhone4 in that its frame rate is about half of the original mode but it offers way better low-light performance. In addition, as opposed to the iPhone4, the latter mode sports way better true resolution (while that of the 1080p mode isn't that bad either, at least compared to the absolutely rubbish, original 480p mode).

    Full sensor caveats: „clicking” sound and freezing video

    Unfortunately, there's a big problem with the latter (full sensor) mode greatly reducing its usability: every once a while (between one and two minutes in general; there may be more occurrences) the video (but not the audio!) recording stops for around a second and the aperture gets set again, meaning a discernible and pretty ugly brightness peak. There is a clear click in the audio stream when video recording resumes. If that's not a problem and you must have absolutely the best video quality (even with these problems), go for the full sensor mode; otherwise, stick with the 1080p mode, which offers about 30 fps and no problems like this – on the expense of reduced resolution and low-light performance.

    The click can be seen and heard in for example HERE (original MOV file), at around 10 s.

    My utility

    As with my iPhone4 hack tool, you'll need to jailbreak your phone and add the Cydia repo http://www.winmobiletech.com/cy (or http://winmobiletech.com/cy ). Inside it, download the 3GS-specific hacker tool:

    [​IMG]

    Note that, as usual, I provide you with the full(!) source. It's HERE. You can freely compile it and deploy on your phone, should you want to avoid using Cydia.

    The tool works exactly than the iPhone4 version. It has two main tabs, of which most users will only want to use the first, Simple view. It has two pickers:

    [​IMG]

    - the left one sets the preferred video mode: 480p, 1080p or full sensor. In general, you'll want to switch between the two latter, depending on your needs as the default, factory 480p mode offers absolutely no advantage over any of the two other modes – as opposed to the case of the iPhone4)

    - the right one sets the data rate. The higher you go on the list, the faster the data rate.

    After making your selection, just tap Go to write the changes.

    I'll release another, updated version some time with rewritten help (now, it refers to the iPhone4) and added average data rates. The 3G S computes the effective data rate than the iPhone 4; that is, the same data rate means about 10 times higher effective data rate on the iPhone4 than on the 3G S. In the meantime, if you find the highest data rate is still too low for your needs, use Advanced view to enter your own ones. The Advanced view is used exactly like on the iPhone4 (it remembers settings over restarts; don't forget to tap “Save” to overwrite the system plist!) and is entirely filled with the default 480p values:

    [​IMG]

    Writing to the system files

    The app uses system calls to make files writable and assumes the root password is still “alpine”. Should this fail (this was the case under 4.2.1; it worked under 4.3.3 on the iPhone4), you will need to change the write permission of some files to “world” using iFile. Even the trial version will suffice of the latter.

    Get iFile and navigate to either /System/Library/Frameworks/AVFoundation.framework/ (if you have iOS 4.3.x) or /System/Library/PrivateFrameworks/Celestial.framework/ (with pre-iOS 4.3). Scroll down to “N88” but don't step into it (note that, on the iPhone4, you do exactly the same, except that you need to scroll down to N90 instead of N88 and, if you prefer allowing writing access to files one-by-one [you don't switch on “Apply hierarchically”], don't need to allow writing to CameraRollValidator.plist and MediaValidator.plist):

    [​IMG]

    Tap the arrow on the right (see red oval in the screenshot above) and switch on “Apply hierarchically” (at the top):

    [​IMG]

    Now, scroll down to the Access Permissions group:

    [​IMG]

    Now, tap “World” (emphasized with a red oval in the above screenshot):

    [​IMG]

    Now, tap “Write” (see red oval above) so that a checkmark appears to the right of it:

    [​IMG]

    Now, you can go back (tap “File Attributes” on the top left) and tap Done in the top right corner so that the permissions are set.

    If you don't want to grant write access to all files in the subdirectory (there're few of them and you can safely do this!), make sure you do the same to AVCapture.plist [in pre-4.3] or AVCaptureSession.plist [in 4.3+], CameraRollValidator.plist and MediaValidator.plist!

    More to come...

    This was strictly an intro to my utility and using iFile to grant file system permissions applicable to both the iPhone 3G S and the iPhone 4. I'll soon (I don't know when; probably today) post a second part, in which I provide you with a lot of frame grabs and example videos, thoroughly comparing the three video modes to each other - and to those of the (enhanced) iPhone 4, in order to make it easier for you to select from it. I will also evaluate and list the user tweaks I've tested (e.g., those of Jekku).

    The second part, however, will "only" be a showcase of examples (emphasizing the quality difference between the available camera modes) and not strictly needed to start using my utility now.


    EDIT
    : with the current (1.0) version, DO use iFile to grant permissions, even if the program is (seemingly) able to set them correctly. I've forgotten to grant a+w to CameraRollValidator.plist and MediaValidator.plist in the app delegate; this is why playback doesn't work in-device. Will fix this too in the next version. Please see my first related post below.

    EDIT 2 later, the same day: New version (1.1) of iPhone 3G S Video Enhancer uploaded to Cydia, with the following changes:

    - CameraRollValidator.plist and MediaValidator.plist are now granted a+w in the app delegate, which means you may not end up having to use iFile to set permissions manually, which means you will be able to play back the high-resolution videos right on your phone, and not only on a desktop computer. (This was missing from v1.0; see the related discussion HERE)

    - I've reworked the previously iPhone 4-specific help text (third tab) and the label (first tab)

    - I've completely changed the right picker column on the first tab; now, it offers far more data rates (from 30kbps to 25 Mbps). Note that the maximal data rates are computed automatically, based on the value you set (five times the value set). Now the first tab looks as follows:

    [​IMG]

    Switching to an entirely numeric column also means greatly simplified code as, now, a simple is sufficient to decide whether a standard data rate is stored in the system plist file (437500 by default; this is why it scrolls there when first run). Switching to storing simple NSNumbers in the array also means the elimination of any switch-case constructs used up to now.

    I've also updated the online sources - feel free to download them to see the changes.

    Feedback, bug reports are more than welcome! Do ask me if you have ANY questions and don't panic if you get any error messages (remember: as it's pretty close to the hardware, it needs to change system permissions, which, in cases, may not work), my program will NEVER render your phone useless and, even if, for some reason, you won't be able to record videos any more (which is highly unlikely!), you'll be easily able to restore that capability without resetting the entire device!
     
  3. badlt1 macrumors newbie

    Joined:
    Jun 16, 2009
    #3
    problem viewing videos on phone

    I have a 3GS running 4.3.3 and my password is still alpine. I installed the hack and set at 1080 and full and I can't view the videos when I select them in the photo folder. any suggestions?
     
  4. westcoastin macrumors member

    Joined:
    May 3, 2011
    #4
    I installed the hack but now am unable to record video, even after uninstalling in Cydia. Any way I can fix this without having to restore? Thanks
     
  5. Menneisyys2, Jun 29, 2011
    Last edited: Jun 29, 2011

    Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #5
    Thanks; this means under 4.3.x the system() calls work on the 3GS, not only on the iPhone 4. Certainly good news. I've forgotten to issue two system() calls to grant a+w to CameraRollValidator.plist and MediaValidator.plist in the app delegate; this is why playback doesn't work in-device. Will fix this too in the next version.

    Do the following to fix this before my official release:

    1.) install iFile
    2.) grant world write to /System/Library/Frameworks/AVFoundation.framework/ recursively (as is explained in the tutorial above)
    3.) restart my utility and set anything so that it surely modifies the two related plist files
    4.) restart the entire phone. (You'll only need to do this once as, after this, the system will register the new, large-sized videos as valid and playable.)
    5.) record something hi-res and try playing it back

    Please report back on the success.


    Sorry for the two missing a+w granting system() calls - I couldn't test it under 4.3.x as my 3G S is running on the iPad baseband and I don't have the time and patience to upgrade from 4.2.1.
     
  6. Menneisyys2, Jun 29, 2011
    Last edited: Jun 29, 2011

    Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #6
    You mean nothing gets recorded, or, just it's unable to play back the recorded movies in-device? If the latter, then, just do what I've described in the prev post. If the former (I seriously doubt it), then, just overwrite the files in /System/Library/PrivateFrameworks/Celestial.framework/ (if you have 4.2.x) with the ones at http://dl.dropbox.com/u/13100693/html/062011iPhone3GSCameraHack/42OriginalPlistFiles.zip - these are the original, non-modified plist files. (Let me know if you need help with installing OpenSSH and accessing the device remotely, from the desktop, via CyberDuck.)

    Please report back as soon as possible so that I can go on helping you before going to the bed.
     
  7. Menneisyys2, Jun 29, 2011
    Last edited: Jun 29, 2011

    Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #7
    New version (1.1) of iPhone 3G S Video Enhancer uploaded to Cydia, with the following changes:

    - CameraRollValidator.plist and MediaValidator.plist are now granted a+w in the app delegate, which means you may not end up having to use iFile to set permissions manually, which means you will be able to play back the high-resolution videos right on your phone, and not only on a desktop computer. (This was missing from v1.0; see the related discussion HERE)

    - I've reworked the previously iPhone 4-specific help text (third tab) and the label (first tab)

    - I've completely changed the right picker column on the first tab; now, it offers far more data rates (from 30kbps to 25 Mbps). Note that the maximal data rates are computed automatically, based on the value you set (five times the value set). Now the first tab looks as follows:

    [​IMG]

    Switching to an entirely numeric column also means greatly simplified code as, now, a simple is sufficient to decide whether a standard data rate is stored in the system plist file (437500 by default; this is why it scrolls there when first run). Switching to storing simple NSNumbers in the array also means the elimination of any switch-case constructs used up to now.

    I've also updated the online sources - feel free to download them to see the changes.

    Feedback, bug reports are more than welcome! Do ask me if you have ANY questions and don't panic if you get any error messages (remember: as it's pretty close to the hardware, it needs to change system permissions, which, in cases, may not work), my program will NEVER render your phone useless and, even if, for some reason, you won't be able to record videos any more (which is highly unlikely!), you'll be easily able to restore that capability without resetting the entire device!
     
  8. badlt1, Jun 29, 2011
    Last edited: Jun 29, 2011

    badlt1 macrumors newbie

    Joined:
    Jun 16, 2009
    #8
    Still can't play back videos on phone

    I followed your instructions and still cannot play recorded video on phone. I then went on Cydia and downloaded the upgraded for 3gs camera hack. but no change, Still unable to watch videos, even restarted the phone. Finally have gone back to Cydia and uninstalled the hack and rebooted the phone and I still cannot view any video I shoot. I can still view some old videos I shot last week before I tried this tweak
     
  9. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #9
    It seems I'll indeed need to upgrade to 4.3.3... in the meantime, are your videos that you take at the factory 480p setting playable? If they aren't, are you sure you've set 480p in the app before removing it using the Cydia interface? If you haven't (but left it at either 1080p or Full mode), reinstall the hack, set back to 480p and check whether your videos are now playable. This will gain you video playability until I upgrade to 4.3.3 and test the hack under it too.

    BTW, I've re-flashed 4.2.1 (with the iPad baseband so I needed to use pwned DFU mode) to check version 1.1 of my program again; works just fine, including playback. That is, 4.2.1 users can safely use the app. Now upgrading to 4.3.3...
     
  10. badlt1 macrumors newbie

    Joined:
    Jun 16, 2009
    #10
    Still not working this morning

    Ok, I read your reply and I went to Cydia and reinstalled iphone 3gs camera hack, First thing, is even though I have the 1.1 version installed Cydia still keeps showing update availiable. If I hit the upgrade button it upgrades, but still shows update available for camera hack

    Ok I tried what you said, I put the setting in camera hack back to 480 and 437500. tried using the camera, it won't open. Camera app hangs at the splash shutter screen. I restarted the phone, no change. I put the setting back at 1080 and the camera app opens, and appears to be working, records video, pics, but can't view the videos. So still no working video camera. I can go back and play older video I shot with camera before I installed this hack, just not able to view any video I have shot since.
     
  11. Menneisyys2, Jun 30, 2011
    Last edited: Jun 30, 2011

    Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #11
    At last, I've managed to upgrade. I was wrong about the two files' ( CameraRollValidator.plist and MediaValidator.plist) location (based on the iPhone4 changes, I though they would also have been be migrated to /System/Library/Frameworks/AVFoundation.framework/N88/ - but they remained in their original dir). This is why enabling the playback of the hi-res videos didn't work. Sorry - I wouldn't have thought Apple approached changes differently with the two different models.

    If you want to fully restore the factory state of 4.3.3 before the official release of v1.2 of my tool with the fixed paths:

    If you have OpenSSH on the device + CyberDuck on the desktop or, if you don't have / because of the security implications, don't want to use OpenSSH, use iPhone Explorer (Mac/Win) / T-Pot (Win) / iPhoneDisk (Mac) / PhoneDisk (Mac), get this file:

    http://dl.dropbox.com/u/13100693/html/062011iPhone3GSCameraHack/43.zip

    Overwrite /System/Library/Frameworks/AVFoundation.framework/N88/AVCaptureSession.plist with the one at 43/avfoundation/N88/AVCaptureSession.plist in the ZIP file.


    EDIT (later the same day, before my upgrading to 4.3.3): this was the old version of my post (I only keep it because it links to an old tutorial, which may be of interest):

    If you do, you could overwrite the two files in charge of playing back hi-res videos right on the phone: CameraRollValidator.plist and MediaValidator.plist , under /System/Library/Frameworks/AVFoundation.framework/N88 :

    http://www.mediafire.com/?qg1hu2lbfb645pn

    (linked from this old tutorial: http://iphoneblogr.com/2010/10/how-to-enable-hd-video-recording-on-iphone-3gs-video-tutorial/. The tutorial itself discusses the old, pre-4.3 iOS, this is why it speaks of the old path, /System/Library/PrivateFrameworks/Celestial.framework/N88. If you keep this in mind and ONLY overwrite these two files, you can use that tutorial if you don't know / have never used any of the apps mentioned in the first sentence above.)

    Before overwriting them, please make a backup of them.

    As soon as I manage to upgrade my 3G S to 4.3.3 (it's not that easy as it's on the iPad baseband...), I'm sure I'll be able to fix this right in the app, without having to manually copy plist files around; that is, the old, awkward and cumbersome way of hacking the camera.
     
  12. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #12
    Continued playing with 4.3.3. The camera indeed doesn't open in 480p mode, as has been pointed out by westcoastin.

    For the time being, only use the hack on pre-4.3 devices, where it works 100%. I'll soon release the fully 4.3.x-compliant version. If you're on 4.3.x and want to restore the default functionality of the camera (without any hacks), just do what I stated in the prev. post:

    Overwrite /System/Library/Frameworks/AVFoundation.framework/N88/AVCaptureSession.plist with the one at 43/avfoundation/N88/AVCaptureSession.plist in the ZIP file at http://dl.dropbox.com/u/13100693/html/062011iPhone3GSCameraHack/43.zip

    Sorry about this - again, I wouldn't have thought Apple uses a different upgrade path (on the file system level) between pre-4.3 and 4.3 on the 3G S and the iPhone 4. This is why I took it granted the changes to the 4.2 file system and property list files when upgrading to 4.3 are the same in the 3G S than in the iPhone 4.
     
  13. zoeconner macrumors regular

    Joined:
    Jul 17, 2007
    #13
    This SUCKS!!! My videos wont play either. Dont try
     
  14. Menneisyys2, Jun 30, 2011
    Last edited: Jun 30, 2011

    Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #14
    Restore the plist file (see my prev post).

    All with iOS 4.3.x (NOT with previous iOS versions - e.g., 4.2.x!): I'll soon release a quick bugfix version with a "Restore Original Configuration" button. If you don't want to manually copy plist files around to fix the incompatible changes made by v1.0/v1.1, this button will automatically fix all these.
     
  15. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #15
    Bugfix ready!!! Source code is at http://dl.dropbox.com/u/13100693/html/062011iPhone3GSCameraHack/iP43GSCamEnhancer.zip (should you want to deploy it at once; the restore code - currently 4.3.x only - is in the restroreOrigConfig method of FirstViewController.m); I'll upload it in the Cydia repo in 10-20 minutes.

    Just press the "Restore Original Configuration" button at the top of Simple view and make sure you kill / restart Camera; it'll restore everything. Feedback is welcome!
     
  16. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #16
    Done - v1.2 is up. The new button is perfectly usable for restoration.

    Hint: if you're on 4.3.x and already want to shoot in hi-res mode without waiting for a next, fully implemented version, select 1080p and a bit speed up to (and including) 1000000. (Higher speeds won't be played back by the system, only a desktop computer / other media players.)

    This will render 480p shooting non-working (neither will Full work). This means if you want to switch back to 480p shooting, just tap the new Restore button.

    This way you can continuously switch between the 1080p and 480p modes- just not with the picker list (the latter should always stay at 1080p and only the data rate should be modified - don't forget don't go over 1000000 to keep the files playable on the 3G S! Interestingly, under iOS versions prior to 4.3, even 25 Mbps files remained playable by the system - after hacking the two plist files, of course.)
     
  17. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
  18. badlt1 macrumors newbie

    Joined:
    Jun 16, 2009
    #18
    Thanks

    Thank you for all your hard work. Video camera is working again and I am now playing with some of the setting.
     
  19. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #19
    Great! :) I've just posted a new version (1.3), with full 4.3 support.
     
  20. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #20
    V1.3 of the iPhone 3G S Video camera enhancer app released with cleaned-up iOS 4.3.x

    I've just posted the new (1.3) version of my iPhone 3G S Video camera enhancer to my Cydia repository. (Please see my previous, dedicated articles [e.g., THIS] on accessing it.)

    Unfortunately, when it runs under iOS 4.3.x, it has two main disadvantages compared to the pre-4.3 version:

    - no on-device playback of anything over 1 Mbps. That is, you can't set for example 2Mbps as your video data rate if you want to watch the video on your iPhone.

    - no Full sensor mode, also meaning less real resolution and worse low-light performance (but much better framerate and no „clicking” bug)

    All in all, if you still have a pre-iOS 4.3 3GS, and liked the Full mode very much and/or frequently used data rates (well) over 1 Mbps, you may not want to upgrade to iOS 4.3.x.

    Feel free to test / use the new version. Again: don't panic if anything goes wrong. If it does, kill the Camera app (as always), restore the default configuration with the top button on the Simple view and set your settings again. Again, don't forget that you won't be play to play back your videos on the iPhone if you set anything over 1 Mbps as data rate!

    Some background for programmers and hackers (as usual, I've made available the sources; they're HERE):

    The only real, plist copying-based solution, that of Inspired Geek modified both the old (/System/Library/PrivateFrameworks/Celestial.framework/N88/AVCapture.plist) and the new (/System/Library/Frameworks/AVFoundation.framework/N88/AVCaptureSession.plist) main plist file. I've found this unnecessary. I've, however, kept the code commented out that helps easily accomplish this without major rewrites. We just make sure we call [SystemPlistContentWrapper populateSystemPlistDictionary] and writeDataToSystemFile twice; once with the original systemVersionHigherThan43 value originally set in the app delegate (and accessed as an extern variable in all other places) and, then, simulating a pre-4.3 mode by temporarily setting this variable to NO and calling the same method; now, on a separate instance kept parallel with the old one keeping the 4.3.x-specific / -formatted property list.

    You'll need to do this in both Single and Advanced view. I've implemented the former (but, again, commented out everything after finishing my tests and finding out we don't need to modify the old plist at all). These are as follows:

    .h:
    @property (retain) SystemPlistContentWrapper* mySystemPlistContentWrapper2; // for 4.3+ to achieve double backup


    .m:
    @synthesize … mySystemPlistContentWrapper2;
    …
    buttonPress:
    ...
    if (systemVersionHigherThan43)
    {
    systemVersionHigherThan43 = NO;
    [self.mySystemPlistContentWrapper2 writeDataToSystemFile:[NSNumber numberWithInt:bitSpeed]
    liveSourceOptions_Sensor_Width:[NSNumber numberWithInt:sensorWidth]
    liveSourceOptions_Sensor_Height:[NSNumber numberWithInt:sensorHeight]
    liveSourceOptions_Preview_Width:[NSNumber numberWithInt:440] // previewWidth
    liveSourceOptions_Preview_Height:[NSNumber numberWithInt:320]
    liveSourceOptions_Capture_Width:[NSNumber numberWithInt:captureWidth]
    liveSourceOptions_Capture_Height:[NSNumber numberWithInt:captureHeight]
    ];
    systemVersionHigherThan43 = YES;
    }

    viewDidLoad:
    ...
    if (systemVersionHigherThan43)
    {
    systemVersionHigherThan43 = NO;
    self.mySystemPlistContentWrapper2 = [[SystemPlistContentWrapper alloc] init];
    [self.mySystemPlistContentWrapper2 populateSystemPlistDictionary];
    systemVersionHigherThan43 = YES;
    }


    I've found out that, in order to avoid 480p mode being stuck, you need to avoid setting the little-used preview dimensions when falling back to 480p; hence the additional if ([newLiveSourceOptions_Sensor_Width intValue]!=640 && [newLiveSourceOptions_Sensor_Height intValue]!=480) block in [SystemPlistContentWrapper writeDataToSystemFile]. Basically, it's the main change (in addition to fully removing „Full” when running on 4.3.x) in the code, compared to v1.2. (Note that, at the end, I've commented out entirely the contents of the block. Otherwise, I would have ended up having to check out the particular case of „return to 480p from 1080p”, which would result in a crash. Unlike on the iPhone4, here's no real 16:9 mode so it's not that important to change the default preview size.)

    The biggest problem is letting >1 Mbps playback (regardless of the capture size; e.g, VGA videos with over 1 Mbps couldn't be played back either, not only 1080p ones). Inspired Geek, in addition to setting the well-known AVCHD parameters, also greatly increased SVQ3's VideoMaxPixelsPerFrame. I found this pretty much useless. (Nevertheless, I've left the code – after commenting it out – in the app delegate for both media validator plists.) On-phone media playback of files with higher video data rate than 1 Mbps worked just fine under pre-4.3 iOS versions.

    Actually, Inspired Geek's modification doesn't go higher in bit speed with high-resolution videos than 800 kbps either (he's using 800k as the hacked speed for high-res video). When modifying 800 000 in AVCaptureSession.plist's AVCaptureSessionPresetHigh/ VideoCompressionProperties/ AverageDataRate to, say, 2800000, reviewing the changes doesn't work any more.

    Full sensor mode has entirely been removed because I just couldn't make it work, no matter how hard I tried. Basically, the programmatical change I've made was very easy: by just adding an else branch to [FirstViewController numberOfRowsInComponent] to hide it from the picker under 4.3 (and show it under pre-4.3):

    if (systemVersionHigherThan43) return 2;
    else return 3;
     
  21. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
  22. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #22
    I have pretty good news for you all 4.3 users (pre-4.3 is not affected as it has always worked except for the Cydia badge bug):

    - I've been able to fix the Cydia badge / update problem
    - found a way to re-enable preview setting storage
    - played with bitrates that can be displayed by QuickTime and found out 1750000 is the maximum. Added this value to the picker

    and last, but definitely not least, found out the Full sensor mode is still working in 4.3, meaning vastly superior real resolution and low-light performance because of the pixel binning. Now trying to find out a working preview value to make video previewing work while shooting. (The shutter, seemingly, stays close, but it's recording video nonetheless.)

    Will soon release the new version.
     
  23. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #23
    ... and it's out!!! With tons of goodies. Please see http://www.iphonelife.com/blog/87/n...-video-recorder-enhancer-released-source-code
     
  24. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #24
    New version released for both the iPhone 3G S and the iPhone 4. Change description and a LOT of resolution chart shots (both photos and original videos) at http://www.iphonelife.com/blog/87/iphone-3g-s-4-video-camera-enhancement-news . As you can see, I thoroughly examine all the different “hacks” the hacking community has produced.

    Feedback is, as usual, more than welcome so that I can finalize the two projects and upload them to a common Cydia repo!
     
  25. Menneisyys2 thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #25
    New version, with vastly enhanced backup / restore capabilities, released to Cydia (of the iPhone 4 version too). I've elaborated very thoroughly on the backup / restore algorithm. I also present some information on minimizing "clicking" using my live view-less 4.3.x Full Sensor mode by using 1.75 Mbps data rate.

    Please see http://www.iphonelife.com/blog/87/i...es-and-restoring-them-iphone-3gs-4-video-came for the article. Feedback welcome!
     

Share This Page