How does Cycorder works?

Discussion in 'iOS Programming' started by Xino, Sep 11, 2008.

  1. Xino macrumors member

    Joined:
    Sep 5, 2008
    #1
    Do you guys have an idea of how Cycorder takes video with the build-in camera? (Or how iPhone video recorder does this)?

    I know it's possible to direct access the camera using the private framework "PhotoLibary" and that works out very well but i'm only able to take pictures with that.

    I think Cycorder uses the camera in a much lower level then "PhotoLibary" does, maybe even by accessing the camera's hardware and calling the pins directly? The question is, how does the creator of Cycorder (saurik) knows the way to do this? I've emailed him but he won't give me detailed information which I understand :)p)

    I want to know this because i'm trying to create a client which makes it possible to make a videocall to another client we've created... Something like Qik but not streaming to the internet, just to another client.

    Hope you can help me out a bit by giving me some hints/tips/etc.
     
  2. mccannmarc macrumors 6502

    mccannmarc

    Joined:
    Aug 15, 2008
    Location:
    Manchester, UK
    #2
    Cycorder is a jailbreak app, hence the developer has access to much lower API functions than we SDKers could possibly hope for. I've a feeling that Apple will open up the API more and more once they're happy they've monopolized the iPhone with every app they see as essential
     
  3. Xino thread starter macrumors member

    Joined:
    Sep 5, 2008
    #3
    You're right about the fact that Cycorder is a jailbreak application and therefore has the possibility to use much lower API's like the PrivateFrameworks. The question I have is if the PrivateFramework (especially PhotoLibary) is enough to create an application as Cycorder because I believe Cycorder is using even lower than that...

    If Cycorder is using much lower API's than the private frameworks (also only available at jailbreaked iphones), which API's are being used and how do I gain access to those API's?
     
  4. yaemes macrumors member

    Joined:
    Mar 24, 2008
    #4
    saurik says cycorder essentially takes pictures as quickly as possible. so he is not using the hardware directly, cycorder is going through the iphone's camera feature before it gets picked up by cycorder.
     
  5. Xino thread starter macrumors member

    Joined:
    Sep 5, 2008
    #5
    Hm I'm not sure about that, I've mailed him once and he said he is accessing the camera directly. Besides that, he is using the hardware MPEG encoder provided by the Infineon PMB8876 S-GOLD 2 chip onboard. The question is how he's accessing this chip. I've searched the internet for C headers, API's, etc. but couldn't find anything interesting.

    The difference between Cycorder and iPhone video recorder is the way encoding works, Cycorder is using the onboard hardware MPEG encoder and iPhone video recorder is creating JPEG's as fast as possible and encode them to a movie after recording (I also don't know how, I was thinking of FFmpeg which was available for iPhone 1.x but not ported yet to iPhone 2.x since it has the ability to convert JPEG's into a movie but since iPhone video recorder is working on 2.x and FFmpeg is not available for 2.x i'm not sure about this, maybe someone can confirm this?)
     
  6. mccannmarc macrumors 6502

    mccannmarc

    Joined:
    Aug 15, 2008
    Location:
    Manchester, UK
    #6
    maybe he has figured it out by himself, hence the reason he is reluctant to share his knowledge!
     
  7. Xino thread starter macrumors member

    Joined:
    Sep 5, 2008
    #7
    You're right about that. I'm also interested in Zodttd's vlc4iphone and because he was busy the last days he posted a message on his blog telling he was working on some projects and one of those projects was doom4iphone (he was helping the guy who is maintaining the project). Together they figured out how to use the raw framebuffer used by the iPhone's screen. He also said this technique is being used by Cycorder to record video.

    Source: http://www.zodttd.com/forums/showthread.php?t=3866

    Maybe somebody can tell me more about the raw framebuffer and tell me what it does?

    I'm thinking Cycorder is displaying the camera preview on the screen and makes "screenshots" of the display using the raw framebuffer. Maybe that's the reason there are no buttons (etc.) in the preview view. But because Cycorder records video even when the user is calling, that wouldn't be correct I guess :/
     
  8. zigzagzone macrumors newbie

    Joined:
    Oct 16, 2008
    #8
    try this project of Max

    Source: http://idevkit.com/forums/tutorials-code-samples-toolchain/41-video-recording-iphone.html

    He use the cameracontroller to displaying the camera preview on the screen and capture raw framebuffer by using UIWindow to convert it to CGImageRef and store it to memory. after capture certain amount of frames (in this project is limit frames to 50 frames, 10 frames/sec) then convert the CGImageRef to UIImage to playback.

    Now I'm searching the method to encode the raw framebuffer to a movie (just like iPhone Video Recorder do) and include the method to record sound together.

    :D
     
  9. Xino thread starter macrumors member

    Joined:
    Sep 5, 2008
    #9
    Thanks I already figured out this is the way to realise it but I never was able to get it working... (didn't have much time to look at it because of another project)

    Anyway, if you got your encoder working correctly, can you please share your source code with us?
     
  10. zigzagzone macrumors newbie

    Joined:
    Oct 16, 2008
    #10
    Sure!

    But currently I can't find encoding method that seem to work yet.:confused:

    And another point, this project use cameracontroller that is the private framework, then I'm not sure It will pass the AppStore policies.
     
  11. Xino thread starter macrumors member

    Joined:
    Sep 5, 2008
    #11
    No it's not going to pass the AppStore policies. There's no good alternative for creating an application which enables videorecorder abilities which is going to pass the AppStore policies.

    I know there's a hardware MPEG-4 encoder onboard (look at the GOLD-2 chipset specifics) and I think Cycorder is using these to encode the frames to a movie. The reason why I think it works like this is because of the movie that's being encoded realtime.

    Another option to encode the frames is to use ffmpeg which is an opensource libary to convert almost any media to MPEG (also JPEG's). I know it was ported to 1.x but it isn't available for 2.x anymore (if I'm correct). Some people tried to port it but they failed and I don't know why (never tried it)... I think this is the way iPhone video recorder works...

    Do you have any ideas to encode your frames? What have you tried till now?
     
  12. OniDaito macrumors newbie

    Joined:
    Sep 9, 2009
    #12
    Does anyone know the current state of play regarding this? I have FW3 on my jailbroken iPhone. Now it seems that Cycorder still works. From waht I gather, its simply taking shots as fast as it can. This is fine for my purposes.

    Now I wanted to use the example given in this thread but iphonedev has just had a revamp and is no more :( Can anyone give me any hints at all or indeed, upload these examples please?
     

Share This Page