找出Quicktime电影的编解码器 [英] Find out the Codec for a Quicktime Movie

查看:222
本文介绍了找出Quicktime电影的编解码器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直想知道是否可以找到使用哪个编解码器解压缩Quicktime影片(例如h.264,motion jpeg。),最好使用 NSString 。我搜索了 Quicktime QTKit api以及所有gettable属性,但均未成功,但我确信必须有一个

I´ve been wondering if it is possible to find out which Codec is used to Decompress a Quicktime Movie (like h.264, motion jpeg.. ), preferable as NSString. I searched through the Quicktime and QTKit api and all gettable attributes with no success, but I am sure there must be a way to do this, but how?

推荐答案

我认为您遇到了这个困难,因为您误解了Quicktime电影-问电影的编解码器是没有意义的,这就是为什么您没有在电影文档中找到它的原因。

I think you're having this difficulty because you're misunderstanding the nature of a Quicktime movie - it doesn't make sense to ask what the codec of a movie is, and that's why you're not finding it in the documentation for movies.

Quicktime电影是由轨道(例如视频轨道,音频轨道等)的集合组成的,每个轨道都引用一个或多个媒体(实际数据)。使用特定编解码器压缩的媒体。例如,通常电影会具有视频轨道和音频轨道,每个轨道都将使用不同的编解码器(可能是h.264和aac)进行压缩-因此,没有一个编解码器

Quicktime movies are made of a collection of tracks (eg. video track, audio track etc.) and each track references one or more media (the actual data). It's the media that is compressed with a particular codec. Usually a movie will have a video track and an audio track, for instance, each of which will be compressed with a different codec (h.264 and aac maybe) - so there isn't one codec for the whole movie.

要找到用于压缩电影视频轨道的编解码器(听起来像您要执行的操作),您需要先获得一个从电影中引用该曲目,然后获得对该曲目媒体的引用,然后找出用于该媒体的编解码器。要获取有关如何存储特定媒体对象的样本的信息,您需要使用 getmediasampledescription 调用。

To find the codec used to compress the video track of the movie (which sounds like what you're trying to do) you need to first get a reference to that track from the movie, then get a reference to the media of that track, then find out the codec used for that media. To get information about how the samples for a particular media object are stored you need to use the getmediasampledescription call.

如果您使用的是QTKit,请通过调用[media quicktimeMedia]获取C级媒体参考-然后您可以将其传递给getmediasampledescription以获得您所需要的信息寻找-编解码器4位标识符位于返回的示例说明的cType字段中。

If you're using QTKit, get the C-level media reference by calling [media quicktimeMedia] - then you can pass this to getmediasampledescription to get the info you're looking for - the codec 4-digit identifer is in the cType field of the returned sample description.

此苹果支持列表中有一些示例代码:

There's a bit of sample code in this apple support list posting :

http ://lists.apple.com/archives/cocoa-dev/2005//Aug/msg00556.html

这篇关于找出Quicktime电影的编解码器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆