我试图找到用于压缩电影的编解码器.我确定我是否需要以某种方式使用CMFormatDescription并获取CMVideoCodecType密钥.我被困在如何通过元数据数组.关于如何检索编解码器的任何想法?
AVURLAsset* movieAsset = [AVURLAsset URLAssetWithURL:sourceMovieURL options:nil];
NSArray *tracks = [movieAsset tracksWithMediaType:AVMediaTypeVideo];
if ([tracks count] != 0) {
AVAssetTrack *videoTrack = [tracks objectAtIndex:0];
//
// Let's get the movie's meta data
//
// Find the codec
NSArray *metadata = [movieAsset commonMetadata];
}
Run Code Online (Sandbox Code Playgroud)