gpt4 book ai didi

iphone - AVVideoProfileLevelH264High41 在 iPhone 4 上中断

转载 作者:太空狗 更新时间:2023-10-30 03:26:45 24 4
gpt4 key购买 nike

我正在使用 AVAssetWriter 压缩视频,该代码在 iOS7 的 iPhone 5 和 4 中均有效。我正在尝试使用 AVVideoProfileLevelH264High41AVVideoProfileLevelKey 来获得比 Baseline 或 Main 配置文件更好的压缩。该代码在 iPhone 5 的 iOS7 中工作,但在 iPhone 4 上中断并出现以下错误。下面错误中列出的这些配置文件中的大多数也不起作用。

有谁知道 High profiles for compression 是否在 iPhone 4 上不起作用,Apple 的文档只说明它需要 iOS6 或更高版本。

> 2013-12-10 18:26:37.637 VideoCompression[677:3707] *** Terminating app

> due to uncaught exception 'NSInvalidArgumentException', reason: '***

> `-[AVAssetWriterInput initWithMediaType:outputSettings:sourceFormatHint:]` For compression
> property ProfileLevel, video codec type avc1 only allows the following

> values: H264_Baseline_1_3, H264_Baseline_3_0, H264_Baseline_3_1,

> H264_Baseline_4_1, H264_Main_3_0, H264_Main_3_1, H264_Main_3_2,

> H264_Main_4_0, H264_Main_4_1, H264_Main_5_0, H264_High_5_0,

> H264_Baseline_AutoLevel, H264_Main_AutoLevel, H264_High_AutoLevel'

> *** First throw call stack: (0x2fd76f4b 0x3a1066af 0x2ec5d833 0x2ec5d70b 0x2ec5d67d
0xbd001 0xbba59 0x3a5e9d1b 0x3a5ea293 0x3a5ea6f7

> 0x3a5fc8f9 0x3a5fcb79 0x3a72bdbf 0x3a72bc84) libc++abi.dylib:

> terminating with uncaught exception of type NSException
NSDictionary *codecSettings = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithInteger:[bitrateTF.text intValue]], AVVideoAverageBitRateKey,
[NSNumber numberWithInt:[maxkeyframeintervalTF.text intValue]],AVVideoMaxKeyFrameIntervalKey,
**AVVideoProfileLevelH264High41,AVVideoProfileLevelKey,**
videoCleanApertureSettings, AVVideoCleanApertureKey,
videoAspectRatioSettings, AVVideoPixelAspectRatioKey,
nil];

NSDictionary *videoSettings = [NSDictionary dictionaryWithObjectsAndKeys:
AVVideoCodecH264, AVVideoCodecKey,
AVVideoScalingModeResizeAspectFill, AVVideoScalingModeKey,
codecSettings,AVVideoCompressionPropertiesKey,
[NSNumber numberWithInt:[widthTF.text intValue]], AVVideoWidthKey,
[NSNumber numberWithInt:[heightTF.text intValue]], AVVideoHeightKey,
//AVVideoScalingModeFit,AVVideoScalingModeKey,
nil];
self.assetWriterVideoInput = [AVAssetWriterInput assetWriterInputWithMediaType:AVMediaTypeVideo outputSettings:videoSettings];
self.assetWriterVideoInput.transform = self.transformAssetWriter;
[self.assetWriter addInput:self.assetWriterVideoInput];

最佳答案

iPhone4不能在ProfileLevelH264High41编码,只有iPhone4S支持

关于iphone - AVVideoProfileLevelH264High41 在 iPhone 4 上中断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20516345/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com