小编use*_*486的帖子

在iOS下检索电影编解码器?

我试图找到用于压缩电影的编解码器.我确定我是否需要以某种方式使用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)

video codec ios

5
推荐指数
2
解决办法
2612
查看次数

标签 统计

codec ×1

ios ×1

video ×1