关于ffmpeg:VideoToolbox对某些H264编码分辨率的不兼容

ffmpeg中应用VideoToolbox进行解码的过程,如果视频编码的H264分辨率比拟怪异,比方300X180或者是320X240这种,反馈一个VideoToolbox session not available

    status = VTDecompressionSessionCreate(NULL,                      // allocator
                                          videotoolbox->cm_fmt_desc, // videoFormatDescription
                                          decoder_spec,              // videoDecoderSpecification
                                          buf_attr,                  // destinationImageBufferAttributes
                                          &decoder_cb,               // outputCallback
                                          &videotoolbox->session);   // decompressionSessionOut
    //session无奈获取到值,如果分辨率不是VideoToolbox能够反对的
    if (decoder_spec)
        CFRelease(decoder_spec);
    if (buf_attr)
        CFRelease(buf_attr);

    switch (status) {
    case kVTVideoDecoderNotAvailableNowErr:
        av_log(avctx, AV_LOG_VERBOSE, "VideoToolbox session not available.\n");

实际上这个问题应该VideoToolbox的自身库兼容性问题,而后提醒的又不太敌对,实际上苹果官网的文档也没有明确的相干阐明,算是一个很诡异的问题。

Overview
--------

VideoToolbox is a low-level framework that provides direct access to hardware encoders and decoders. It provides services for video compression and decompression, and for conversion between raster image formats stored in CoreVideo pixel buffers. These services are provided in the form of session objects (compression, decompression, and pixel transfer), which are vended as Core Foundation (CF) types. Apps that don't need direct access to hardware encoders and decoders should not need to use VideoToolbox directly.

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理