PDA

View Full Version : Video Encoding




davbeck
Oct 29, 2009, 01:40 PM
I'm kinda a complete noob when it comes to video encoding. I have made an application that records the iPhone simulator (http://davidbeckblog.com/2009/10/iphone-screen-capture/) 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?



uuaschbaer
Oct 29, 2009, 02:21 PM
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?

davbeck
Oct 29, 2009, 02:24 PM
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.

uuaschbaer
Oct 29, 2009, 02:35 PM
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.

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.

davbeck
Oct 29, 2009, 02:39 PM
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.

uuaschbaer
Oct 29, 2009, 03:02 PM
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 (http://developer.apple.com/sdk/)? (Search for 'Image Capture'.)

Cromulent
Oct 29, 2009, 03:38 PM
Do you know of any image capturing software that outputs losslessly? It might be impossible.

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).

davbeck
Oct 29, 2009, 03:42 PM
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.