HD video on iPhone 3GS [4.2]

Update: Someone made a free Cydia app that works for all iOS 4.x

Original Post:

I am back again!  Just jailbroke my 3GS with firmware 4.2 and updated the HD video hack.

This release fixed the ‘clicking’ autofocus problem in the previous release and is compatible with iOS 4.2.x

Download the updated HD Video file here
Instructions:
1. Jailbreak your device and install afc2 from Cydia
2. Download iPhoneBrowser from http://code.google.com/p/iphonebrowser/
3. Connect the phone to the computer via USB
4. Decide if you want HD or SuperHD, see screenshot for a comparison
5. Browser to /System/Library/PrivateFrameworks/Celestial.framework/N88/
6. Replace the 3 plist files from ones from the HD folder or SuperHD folder
7. Respring your iPhone 3GS

Alternatively, you can also skip step 2 and 3 and copy the file over using SSH.

Here is another sample video:

Enable HD video recording on iPhone 3GS

Summary:

  • Last updated December 2010 for iOS4.1, Click here for the newest release for iOS 4.2.
  • I added ‘Super’ high quality mode in rev4, which uses the camera sensor in still image mode  to capture video, so it will only record at 15fps, but the quality is amazing as evident in the above picture.
  • In ‘Super’ high quality mode (15fps), the camera sometimes makes a ‘clicking’ noise when focusing and then the video recording lags for half a second.  It helps if you close all other background apps.
  • You are recording at 1080×800, which is ~4:3 aspect ratio, just like the original video.
  • The video is a lot higher in resolution and bitrate than the original, thus the files are bigger, and it will take more power to encode.  Keep an eye on the disk space and battery life!  Also, disable background apps might improve performance.
  • if you email the video or send it to youtube using iOS, it will reencode it to a lower quality.  Use Pixelpipe from the appstore to upload in original quality, or download it to your computer to view the video in full resolution.
  • This hack is for iOS 4.1, I have not tested this with older versions of iOS.  But supposedly it works on 4.2 as well.
  • Someone made a cydia App called 3GS HD Enabler under the modmyi repo for the less technical inclined.

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.  So all we need to do is by-pass the artificial limitation Apple has imposed on the hardware.  Here is a way to get the phone to record video (and playback on the iPhone) at 1080×800 @ 30fps at up to 15Mbps.  (up from the original 640×480 @ 3Mbps)  (I am using the odd resolution of 1080×800 in order to keep the video at the right aspect ratio)

The quick method:
Jailbreak your iDevice, install Cydia, and search for the app ’3GS HD Enabler’.  Enjoy.

The manual method:
Jailbreak your iDevice and install SSH
Download the pre-edited file HDVideo3GS.zip.
Decide if you want HD or SuperHD, see comparison of different video mode.
Copy the 3 .plist files to /System/Library/PrivateFrameworks/Celestial.framework/N88/ (Backup your original!)
Respring your iPhone 3GS and enjoy HD video

Details, for the tinkerers:

  • 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.  Setting it to the full size (2048×1536 seems to turn on a special ‘photo mode’, which is slower than video mode, but the quality is much better)
  • 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.
  • 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 all instances of 768 with 1920
  • And replace  <key>MaxLevel</key><integer>30</integer> with  <key>MaxLevel</key><integer>31</integer>
  • Save these two files and respring your iDevice

Results:

iPhone Photography

I recently got an iPhone 3GS, the camera that’s built into the phone is a pretty big disappointment for someone who shoots dSLR for the past year.  Super-noisy at base ISO 100, no manual control, shutter lag… it’s a mess.  Granted, big lenses and big cameras are super cool, and they take amazing pictures.  But this post is about living with, and taking advantage of the tiny camera on a camera phone.

Lesson 1: Know the limit of your camera, and try to work around it.
Vancouver sunset
Small cameras are known for their low dynamic range, so to get the most out of this sunset, I took two images at different exposure and merged them together with Pro HDR, right on the phone.  This increased the dynamic range dramatically, making it equal to that of a dSLR.  Then a bit of contrast and saturation boost completed the look.

Lesson 2: Post Processing
i am {not} on a boat
This picture came out very bland at first, but a few tweaks in Lightroom 3made it marginally passable.  There are enough apps in the Apple Appstore to edit your photo into oblivion and back.  Some of my favorite apps are Pro HDR, TiltShiftGen and Best Camera. Of course, for the most control, you’d have to use a desktop-based tool like Lightroom or Aperture.

Lesson 3: Color
Metrotown through iPhone
What the tiny camera lacks in light-gathering ability, it makes up by upping the vibrancy and contrast.  iPhone photos are usually a lot more vibrant and contrasty than what you get out of a high-end dSLR.  Use this to your advantage to capture some eye popping pictures.

Lesson 4: Bokeh
Untitled
You CAN throw the background out of focus even on a tiny sensor like the iPhone camera, but only if you are shooting in macro.  Just be patient with the focus, it can take a while to get the razor sharp image that you wanted.

That’s all for now, I am still discovering the capability of the iPhone camera.  Let me know if you have any tips regarding digital photography.

The perfect laptop!

I was window-shopping for laptops today and discovered the amazing Asus UL30 series.  It’s truly an amazing piece of engineering: it’s thin, it’s light, it’s fast, has an insane battery life, and pretty cheap.  Let me break down the specs for you non-geeks:

Core 2 Duo SU7300 Processor:
It has a 1.3Ghz (up to 1.7Ghz with TurboBoost technology), ultra-low-voltage processor manufactured on 45nm technology.  Which really just means the processor can do a LOT of work while barely sipping on your precious battery.  Honestly, it’s unbelievable how fast this processor is while using less than 10W of power.  [Compare with a 13 MacBook Pro: slightly slower, but uses 1/3rd the power)

Nvidia G210M 512MB and Intel 4500 Graphics:
This .93 inch thin laptop has TWO graphics cards.  The Nvidia G210 is probably the fastest graphics card available on a 13 inch laptop.  It's build on 40nm technology, and uses a max of 14W of power, which is still impressive for a graphics card of this caliber.  The Intel is slower, but uses even less power.  You can toggle between the 2 to trade off performance for battery life. [Compare with a 13" MacBook Pro:  The Asus is twice as fast, while using the same amount of juice]

4GB DDR3 RAM:
Also, the laptop can support a max of 8GB of memory, you know… in case you need that much. [Same as Macbooks.]

13inch LED-lit Screen:
LED also means it’s uses less power than regular backlights. [same as Macbooks]

12 hour battery life:
…or so Asus claims, you can probably expect 10 hours of real world usage, and maybe 4-5 hours of gaming/heavy 3D work. [much longer than the MacBook Pros]

Design:
Not quite on par with Apple’s drool inducing one-piece aluminum finish, but it’s one of the nicer laptops I’ve seen (once you get rid of all the stickers).  The design is obviously Macbook inspired.  And it’s really light and thin.

Price:
$800 USD.  I know you can get an even faster 15″ laptop for $900, but the battery life and portability also suffers as you up the screen size.  13″ with this amount of computing power is perfect.  It also comes with all the standard bells and whistles: webcam, bluetooth, 802.11n, and a half terabyte harddrive.

The bottom line:
if you are looking for a portable powerhouse, take a closer look at this laptop.  If you want raw power and don’t care about battery life or portability, skip this.

Update: I’ve had this laptop for almost a year now and am very happy about it.  It’s light enough to be carried everywhere, and with 8 hours of up time on the integrated video card (can be stretched to 10 if you are stingy on screen brighness or wifi), I don’t even need to carry the AC adapter unless I plan an overnight trip.  My only complain is that the screen has an absolutely horrific viewing angle, color shifts are common when viewed off-axis; and black is a muddy gray at best.  But once you plug this thing into an IPS display via the build in VGA or HDMI cable, the Nvidia G210M chip is beefy enough to play StarCraft II at medium settings.