1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Video Encoding

Discussion in 'Mac Programming' started by davbeck, Oct 29, 2009.

  1. macrumors regular

    I'm kinda a complete noob when it comes to video encoding. I have made an application that records the iPhone simulator but I am having trouble figuring out the correct video encoding method.

    Currently, I am setting each frame using QTMovie's addImage:forDuration:withAttributes:. For the attributes, I am setting QTAddImageCodecType to be either png or jpeg.

    When I use png, it takes way too long to render. I like png otherwise, because it give a lossless look. It also allows me to use a transparent background.

    Jpeg renders at a good speed, but it is not very good quality and looses transparency.

    There must be some kind of middle ground. Is there anything that has transparency?
  2. macrumors regular


    How can the not compressed (well, lossless) PNG be rendered slower than a, first, uncompressed image that then, secondly, has to be compressed (not losslessly) ? I'm wholly ignorant of these matters, but I can think of no other way to explain this than the extra time it costs to write an entire PNG on a hard drive. (Although shouldn't it be recording unto the RAM?)
    But whichever reason there is for the slowness, how can it be possible to record an entire screen, but not an iPhone sized portion?
  3. macrumors regular

    I don't think I understand your question. The program records the screen of the iPhone plus a little extra so the pointer doesn't fall off the edge.
  4. macrumors regular


    Quite an ingenious idea, but I just can't image how it could take longer to render a png than a jpeg, that's all.
  5. macrumors regular

    Oh yes that kind of baffled me as well. It is the writing to the video, not the file, that takes up most of the time. It's about 5 seconds to render for each 1 second of recording.
  6. macrumors regular


    Do you know of any image capturing software that outputs losslessly? It might be impossible.
    (Although if a computer can record 2650*1440 in lossy format, it should be able to record 480*320 losslessly, I would say.)

    Have you used this? (Search for 'Image Capture'.)
  7. macrumors 603


    I'm not sure about any image capturing software as such. But if you are referring to video then it is certainly possible. You just need a hard drive that can keep up.

    Recording uncompressed PAL video (720 x 576) requires hard drives capable of 24 MB/s and uncompressed 10bit 1080i requires a sustained hard drive transfer rate of 182.3 MB/s (which is RAID 0 territory).
  8. macrumors regular

    Ok let me rephrase that. By in between, I meant a format that has minimal lossy compression. The difference between png and jpeg is really big.

Share This Page