HD video on iPhone 4S

You think shooting movies in 1080p on the iPhone 4s is impressive? Turns out, the sensor used by the iPhone 4S could do so much more.

According to the rumored spec, the OV8830 chip used in the 4S is capable of “full 8-megapixel (3264 x 2448) resolution @ 24fps, 6-megapixel (3264 x 1836) resolution at 30fps, and full HD at 30 or 60 fps.” [http://www.ovt.com/products/sensor.php?id=102]

Forget the tiny sensor, the mediocore lens, the massive amount of rolling-shutter, the hasty h264 encoding. Just imagine, for a second, Being able to shoot 4k on a camera-phone, or 1920×1080 at 60fps.

How long before we see hacks out in the wild that let us unleash their inner James Cameron?

Update: Maybe not that far off. Shots done on the iPhone already made it into The Avenger.

The most understated game engine

Gamekit is fully compatible with Blender, runs on Windows, Mac, Linux, iOS and Android, and uses a completely non restrictive license so you are free to sale your game without worrying about copyright issues.

Chances are, you’ve never heard of Gamekit.

Despite a simple website, and a whole bunch of confused users who want to try gamekit but don’t know how, gamekit is pretty darn functional already. Within half an hour, you can make a simple 3D game that compiles and runs on an iPhone. It also supports shaders, physics, animation and lua scripting. If you a looking to replace the Blender game engine with something lighter, faster and more modern, take a look at this game engine.

Sure the documentation is a little sparse, but as more artists start using this engine, hopefully we’ll see more literature on the topic.

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: