Edit: Let me present you my working 60 fps video recorder for the iPhone 5!

Discussion in 'iOS 7' started by Menneisyys2, Jun 21, 2013.

  1. Menneisyys2, Jun 21, 2013
    Last edited: Jun 25, 2013

    macrumors 603

    Joined:
    Jun 7, 2011
    #1
    EDIT: In the meantime, I've published a FULL article on all these questions. Please check out http://forums.macrumors.com/showthread.php?t=1602171 . I only keep my now-outdated posts here for historical reasons. That is, you do NOT want to read this thread - it's outdated.





    Old post:
    ----



    Guys, as far as my original post is concerned (see below), I was wrong, fortunately. I've just blindly assumed selecting the 720p60 fps mode (the 13/14th element in the AVCaptureDeviceFormat array returned by AVCaptureDevice.formats) will also shoot at the maximal 60 fps. Nope, it needs to be manually enforced too:

    videoDevice.activeVideoMaxFrameDuration = CMTimeMake(1,60);

    where videoDevice is:

    AVCaptureDevice *videoDevice = [AVCaptureDevice defaultDeviceWithMediaType:AVMediaTypeVideo];

    (the activeVideoMaxFrameDuration property, along with AVCaptureDevice.formats, is iOS7+ only. activeVideoMaxFrameDuration should be preferred to the now-deprecated AVCaptureConnection.setVideoMaxFrameDuration / setVideoMinFrameDuration)

    I've uploaded a program freely compilable & deployable app shooting in any configurable mode (it also displays them) to https://dl.dropboxusercontent.com/u/81986513/062013/ios7b1-60fps.zip

    I didn't bother implementing a GUI to start / stop recording or touch-to-focus. Currently, it starts recording as soon as you start the app and stops it after 7 seconds. (Settable in [NSTimer scheduledTimerWithTimeInterval:7.0 target:self selector:mad:selector(onTimerExpired) userInfo:nil repeats:NO]; ) Feel free to use it. Also feel free to tell me if you don't know how a controller GUI should be implemented and, if and only if I have some free time, release a more complete version actually usable in everyday shooting.

    Original post (outdated, only kept for historical purposes):


    Guys, a quick heads-up as a lot of you have asked me (the developer of several video enhancer JB tweaks) for info on this:

    - on the iPhone 5, the low-resolution 720p60 mode is available theoretically. (Low resolution, as has been explained in my past articles and forum posts - for example, the second half of http://forums.macrumors.com/showpost.php?p=16749279&postcount=7 - here, means halved vertical resolution. That is, it's 360 rows only.) It is listed as a working one and no exception is thrown when set it as the video mode to use from a third-party app. (From the stock Camera app, you can only record at 1080p30. There are no 60p modes listed for 1080p.)

    - it doesn't actually record at 60 fps either. The recorded footage is 30p. However, it surely is binned as the vertical resolution, compared to the stock 30p 720p mode, is halved.

    That is, don't expect miracles, at least not on current hardware. The 5S, on the other hand, may be able to record even 1080p60. Hopefully it will.

    In 1-2 days, I'll come up with a complete elaboration on both this (along with an actual demo app you can deploy on your iPhone to recordin in the two “60p” modes yourself) and the multitasking enhancements.
     
  2. macrumors 6502a

    Sirious

    Joined:
    Jan 2, 2013
    Location:
    United Kingdom
    #2
    That was like a hint or sneak peak at the iPhone 5S's features.
     
  3. macrumors regular

    Joined:
    Jun 12, 2013
    #3
    I use my iPhone with as a sports action camera with an Optrix case and I REALLY hope that they enable 60fps in the higher 720p resolution as it would be awesome for videoing mountain biking and motocross. Let's hope for the best.
     
  4. Menneisyys2, Jun 21, 2013
    Last edited: Jun 21, 2013

    thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #4
    I'm pretty sure 720p60 for the 4S / 5 will be enabled in later betas / the final iOS7 version.

    It, however, will be the same crippled, half-resolution version with 360 lines' vertical resolution only. That is, as crippled as was under the iOS5 times (on the 4S only, obviously, as the 5 initially came with iOS6). Noone should expect 1080p60, not even proper 720p60 (without further resolution halving.) That is, it's impossible to sample an inherently slow sensor faster using software optimization only.

    EDIT: see the edited starting post. I was wrong: it's possible to make 720p60 work even in beta1.
     
  5. Menneisyys2, Jun 21, 2013
    Last edited: Jun 21, 2013

    thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #5
    EDIT: moved the post to the original thread starter post.
     
  6. Menneisyys2, Jun 21, 2013
    Last edited: Jun 25, 2013

    thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #6
    EDIT: In the meantime, I've published a FULL article on all these questions. Please check out http://forums.macrumors.com/showthread.php?t=1602171 . I only keep my now-outdated posts here for historical reasons.


    Old post:
    ----
    More info on the camera support in iOS7:

    1, I've released another version of the camera recorder – it's at https://dl.dropboxusercontent.com/u/81986513/062013/ios7b1-60fps2.zip . Now, you aren't supposed to give it the particular AVCaptureDeviceFormat instance you want to shoot in. Instead, it just iterates over all available (and usable – this is why the last two (four), full sensor oversampler modes aren't used) modes and creates a 10-second clip in each mode. More info on this later, in Bullet 4.

    2, the stock Camera client uses a somewhat narrower FoV than the camera accessed by my above app. This is why the 1080p shot is considerably wider on the framegrab from my app's output than on that of the stock Camera app.

    3, the just-added dynamic zoom, in 1080p mode, does result in some severe quality degradation when fully zoomed in. This is certainly understandable as the zoom factor of the stock client can be around 3, while the theoretical maximum of lossless zoom on a 8 Mpixel 4:3 sensor in Full HD mode is 3264 / 1920 = 1.7. No matter what algorithm Apple uses, it'd be simply impossible to shoot anything over the 1.7 zoom factor with an 1:1 sensor pixel / output image picture mapping. And this ain't a Nokia Pureview 808, which, thanks to its 41 Mpixel sensor, allows for lossless zoom up to 7728/1920=4x. The 8-Mpixel sensor of the iPhone 5 is a long cry away.

    Let me show you an example of this:

    This is the setup:

    https://dl.dropboxusercontent.com/u/81986513/062013/reschartshootingsetupT.jpg

    (Original, full-size image: http://www.flickr.com/photos/33448355@N07/9104678612/sizes/o/in/photostream/ )

    This is the non-zoomed-in pic:

    https://dl.dropboxusercontent.com/u/81986513/062013/stock camera no zoom CROP.jpeg

    (Original, full-size image: http://www.flickr.com/photos/33448355@N07/9104682856/sizes/o/in/photostream/ )

    This is the fully zoomed in one:

    https://dl.dropboxusercontent.com/u/81986513/062013/stock camera full zoom CROP.jpeg

    (Original, full-size image: http://www.flickr.com/photos/33448355@N07/9104686464/sizes/o/in/photostream/ )

    As you can see, the resolution has severely decreased.

    4, OK, now, let's see how the two 720p60 modes (mode 12 and 13) behave. (The only difference between them is the color mode.)

    Unfortunately, while they're 60 fps, they exhibit not only vertically, but also horizontally halved resolution. This means anything you record in this mode will have the effective resolution of 1280//2 * 720/2 pixels only.

    In this regard, the currently only way of recording with more than 30 fps is certainly inferior to that of the iOS5 times, where you weren't forced to use binding. Then, “only” the vertical resolution was halved.

    https://dl.dropboxusercontent.com/u/81986513/062013/ios7-mode12.jpeg

    (Full-sized image: http://www.flickr.com/photos/33448355@N07/9104692444/sizes/o/in/photostream/ )

    This is how it looks in non-binned 30 fps 720p mode (here, mode 10):

    https://dl.dropboxusercontent.com/u/81986513/062013/ios7-mode10.jpeg

    (Full-sized image: http://www.flickr.com/photos/33448355@N07/9104690690/sizes/o/in/photostream/ )

    Note that in the same Flickr set you can find all the framegrabs of the other modes too.
     
  7. macrumors regular

    Joined:
    Jun 12, 2013
    #7
    As I'm not technically advanced and most of your text is jargon to me, did you say that the beta1 software will let you do true 720p60fps video? If so, I'm excited.
     
  8. thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #8
    It is. Will publish a full, cleaned-up, more approachable article today on this.

    BTW, can you deploy apps on your iPhone? If you can, and want a recorder that has a start/stop icon, I'll code it too. (After all, my already-ready sample app needs little modification to incorporate a GUI component with the necessary callbacks.)
     
  9. macrumors regular

    Joined:
    Jun 12, 2013
    #9
    I have Xcode installed on my Mac but have little experience with installing apps. I'm sure that I could do some searching on how to do it. I'd definitely be interested in giving it a shot.
     
  10. thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #10
    OK, it'll be VERY soon ready. Hopefully this evening. (One with automatic starting / ending is already available for compilation and deployment - see above. Of course, it's not interactive.)
     
  11. macrumors regular

    Joined:
    Jun 12, 2013
    #11
    Beta 2 was just released today. Is there any chance that this update could kill your work?
     
  12. thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #12
  13. thread starter macrumors 603

    Joined:
    Jun 7, 2011
  14. thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #14
  15. macrumors regular

    Joined:
    Jun 12, 2013
    #15
    Looks like a good read. I'll crack into it soon. Thank you for your time in putting it together.
     
  16. thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #16
    You're welcome. Don't hesitate to post if you have problems.

    Also, I'll release more advanced versions of the app in the near future.
     
  17. macrumors regular

    Joined:
    Jun 12, 2013
    #17
    Newbie question:
    I have XCode but have never actually used it before. How do I compile the app?
     
  18. thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #18
    Do you have a $99 dev license?
     
  19. macrumors regular

    Joined:
    Jun 12, 2013
  20. thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #20
    Any friends with one that could reg your device to the dev portal?
     
  21. macrumors regular

    Joined:
    Jun 12, 2013
    #21
    My phone is registered and I'm running 7.0b2. I've got a buddy who is a dev and I do some testing for him.
     
  22. thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #22
    Great! He'll be able to compile and deploy the app. Report back if you have problems.
     
  23. macrumors regular

    Joined:
    Jun 12, 2013
    #23
    Unfortunately not. He used to use the "appmakr" system so he doesn't actually know how to make/compile apps. No worries.
     
  24. thread starter macrumors 603

    Joined:
    Jun 7, 2011
    #24
    I can post a quick intro to getting the necessary certs for compiling...
     
  25. macrumors regular

    Joined:
    Jun 12, 2013
    #25
    That would be great! Any help is much appreciated.
     

Share This Page