views:

268

answers:

1
+2  Q: 

QTKit PAL Mode

I used MyRecorder sample by QTKit, it records everything but I have a problem that my camera is PAL and the resolution of H264 encoding for PAL and NTSC are different. PAL is 724x568 and NTSC is 724x480.

When I choose QT Profile for H264High, it by default takes only 724x480 NTSC resolution output file but my camera is 724x568 so the final output has lots of unwanted horizontal lines in between moving objects.

I know the problem is only resolution settings but QTKit is so closely coded, there are no settings to change any encoder parameters.

However apple recommends to use QTKit only instead of earlier sequence grabber approach, but our large customer base will have PAL cameras only and we need some solution to enable PAL resolution. Can anyone guide us?

+2  A: 

It doesn't look like their is an easy way to do this with QTKit as of now.

Using only QTKit you have a couple of options:

  1. What you could do is simple stream the data from your camera into a Quicktime movies using QTCompressionOptionsLosslessAnimationVideo, and then convert the file to H.264 at the resolution you want using the QTMovie class. This option uses up a lot of disk space, but is fairly simple.

  2. Use QTCaptureDecompressedVideoOutput instead of QTCaptureMovieFileOutput, and when you get the call to outputVideoFrame:withSampleBuffer:fromConnection:, buffer the video frames in a thread safe queue. Then in a secondary thread, pull from this queue and add the frame to a QTMovie that you've set up for H.264 encoding with your PAL resolution.

Approach 2 will save you the disk space but is a bit more work, and you'll have to worry about threading concerns, but until there are more options available to us in the QTCaptureMovieFileOutput class that is the best you can do.

Nick Haddad
Thanks, I cant use 1st option because it will take too much of time to first save and then read from disk and reconvert into h264 takes longer time then the recorded video. We tried this option, and it turns out that we record 5 min of video, reconversion in h264 takes 6 mins, and so on if we have 100 videos of 5 mins, it takes too long, i want to explore 2nd option, can you give me or guide me on code sample, i am new on iMac Dev.
Akash Kava