首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AVAssetWriterInput目前不支持AVVideoScalingModeFit

AVAssetWriterInput目前不支持AVVideoScalingModeFit
EN

Stack Overflow用户
提问于 2017-10-25 13:29:36
回答 1查看 444关注 0票数 1

我正试着用AVAssetWriter录制一段视频。我需要更深入的控制输出,而不是AVAssetExportSession提供的预置.我试图在我的AVVideoScalingModeFit中使用输出模式AVAssetWriterInput,但这会导致崩溃,声明:

AVAssetWriterInput目前不支持AVVideoScalingModeFit

下面是我使用的视频设置:

代码语言:javascript
复制
   let videoSettings: [String : Any] = [
        AVVideoCodecKey: AVVideoCodecH264,
        AVVideoWidthKey: 450,
        AVVideoHeightKey: 450,
        AVVideoScalingModeKey: AVVideoScalingModeFit,
        AVVideoCompressionPropertiesKey: [
            AVVideoAverageBitRateKey: 1000000,
            AVVideoProfileLevelKey: AVVideoProfileLevelH264Baseline41,
            AVVideoAllowFrameReorderingKey: false,
            AVVideoExpectedSourceFrameRateKey: 23
        ]
    ]

我的问题有两个: 1)如果我不能使用它,为什么会有这种模式? 2)如果我能使用它,我应该怎么做?

其他人提出了这一问题,但仍未得到答复。见:here

EN

回答 1

Stack Overflow用户

发布于 2017-12-12 23:45:20

1)仅仅因为AVAssetWriter不支持AVVideoScalingModeKey,并不意味着它在AVFoundation的其他地方不受支持。

2)使用Core或VTPixelTransferSession或任何适合您的管道的内容,自己缩放视频帧。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46933782

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档