QTKit PAL 模式
我使用 QTKit 的 MyRecorder 示例,它记录了所有内容,但我有一个问题,我的相机是 PAL 并且 PAL 和 NTSC 的 H264 编码的分辨率不同。 PAL 为 724x568,NTSC 为 724x480。
当我为 H264High 选择 QT Profile 时,默认情况下它仅采用 724x480 NTSC 分辨率的输出文件,但我的相机是 724x568,因此最终输出在移动对象之间有很多不需要的水平线。
我知道问题只是分辨率设置,但 QTKit 编码如此紧密,没有任何设置可以更改任何编码器参数。
然而,苹果建议仅使用 QTKit 而不是早期的序列采集器方法,但我们的大型客户群将仅拥有 PAL 相机,我们需要一些解决方案来启用 PAL 分辨率。 有人可以指导我们吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前看来,使用 QTKit 来完成此操作并不是一个简单的方法。
仅使用 QTKit,您有几个选择:
您可以做的就是使用
QTCompressionOptionsLosslessAnimationVideo
将数据从相机简单流式传输到 Quicktime 电影中,然后将文件转换为 H.264使用 QTMovie 类获得您想要的分辨率。 此选项会占用大量磁盘空间,但相当简单。使用 QTCaptureDecompressedVideoOutput 而不是
QTCaptureMovieFileOutput
,当您收到对 outputVideoFrame:withSampleBuffer:fromConnection:,将视频帧缓冲在线程安全队列中。 然后在辅助线程中,从此队列中提取帧并将帧添加到您已设置为使用 PAL 分辨率进行 H.264 编码的 QTMovie。方法 2 可以节省磁盘空间,但工作量更大,而且您必须担心线程问题,但在 QTCaptureMovieFileOutput 类中有更多可用选项之前,这是您能做的最好的选择。
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:
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.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.