HOW TO: Enable 720p Video Recording On iPhone 3Gs

We showed you how to enable HDR on iPhone 3Gs, now it’s time to enable HD video recording. One quick look at the ARM Cortex processor that the 3Gs uses [PDF Spec], it’s apparent that the chip is capable of handling 720p video encoding.

NOTE: Tested on iOS 4.1

NOTE: BACK UP your files

NOTE: Most probably this will be released in Cydia. If you don’t know what you’re doing, or don’t like to experiment with your iPhone, wait for the tweak…

NOTE: due to the aspect ratio, it’s not actually 720p but it is (can be considered) HD. The headline says ‘720p’ because, well… it just sounds better.

Requirements:

  • jailbroken iPhone 3Gs, running iOS 4.1 ( not tested on previous releases )
  • OpenSSH installed

HowTo:

Short version:

  • Download the pre-edited file HDVideo3GS.zip.
  • Jailbreak your device and install SSH
  • Copy N88AP.plist to /System/Library/CoreServices/SpringBoard.app/
  • Copy the 3 other plist files to /System/Library/PrivateFrameworks/Celestial.framework/N88/
  • Reboot your iPhone 3Gs

( You might want to take a look at the long version below ) .

Long version:

  • Via SSH, open /System/Library/PrivateFrameworks/Celestial.framework/N88/AVCapture.plist with a Plist editor
  • Under the AVCaptureMode_AudioVideoRecording key, set the width and height for the capture key to 1080×800, respectively.  This value controls the dimension of the video it is encoded at.
  • Set the width and height for the preview key to 440×320.  This value controls the size of the on-screen preview.  It does not have any effect on the final video.
  • Set the width and height for the sensor key to 1920×1080.  This value controls the active region of the sensor, so basically, we want to use the entire sensor.  This source will be automatically downscaled to the proper resolution at encoding time.
  • Increase the encoding average bitrate to 20Mbps (20000000bps), this records a much larger video file (~ 2MB for every second of video)
  • Increase the encoding bitrate cap to 40Mbps.  Also, lower the minimum quantizer from 19 to 15 or something, just for the heck of it.
  • Set the H264 profile from 3_0 to 3_1  (because wikipedia says so)
  • Save and close this file.
  • To make the phone playback the recorded HD video. Simply edit CameraRollValidator.plist and MediaValidator.plist, they can be found in the same place as AVCapture.plist. (If you don’t do this, the file can only be played back on your computer)
  • Replace 768 with 1280
  • And replace:
<key>MaxLevel</key>
<integer>30</integer>

with

<key>MaxLevel</key>
<integer>31</integer>
  • Save these two files.
  • Open /System/Library/CoreServices/SpringBoard.app/N88AP.plist with a Plist editor, and add the following under the capability node, this will enable HD recording from the camera app:
    <key>720p</key>
    <true/>
    <key>hd-video-capture</key>
    <true/>
  • Reboot your iPhone 3Gs.
[via Mike Pan]