cuốn sách gpt4 ai đã làm

ios - -[AVMvidFrameDecoder advanceToFrame :] 'framebuffer num bytes' 中的 AVAnimator 断言失败

In lại Tác giả: Walker 123 更新时间:2023-11-29 01:44:12 hai mươi bốn 4
mua khóa gpt4 Nike

我已经从 Github 上下载了最新的 AVAnimator 库代码。除了 AutoPropertyRelease.h 和 AutoPropertyRelease.m 之外,我还添加了 AVAnimator 和 LZMASDK 文件夹。

我正在使用以下代码播放带有 alpha channel 的视频(从另一个 AVAnimator 应用程序示例中采用):

 CGRect iPhoneExplosionRect = CGRectMake(0, -2, 640/2, 480/2);
CGRect iPadExplosionRect = CGRectMake(0, -5, 840, 630);

NSString *rgbResourceName = @"ExplosionAdjusted_rgb_CRF_30_24BPP.m4v";
NSString *alphaResourceName = @"ExplosionAdjusted_alpha_CRF_30_24BPP.m4v";

// Output filename

NSString *tmpFilename;
NSString *tmpPath;
tmpFilename = @"Explosion.mvid";
tmpPath = [AVFileUtil getTmpDirPath:tmpFilename];

// Set to TRUE to always decode from H.264

BOOL alwaysDecode = FALSE;

if (alwaysDecode && [AVFileUtil fileExists:tmpPath]) {
BOOL worked = [[NSFileManager defaultManager] removeItemAtPath:tmpPath error:nil];
NSAssert(worked, @"could not remove file %@", tmpPath);
}

// This loader will join 2 H.264 videos together into a single 32BPP .mvid

AVAssetJoinAlphaResourceLoader *resLoader = [AVAssetJoinAlphaResourceLoader aVAssetJoinAlphaResourceLoader];

resLoader.movieRGBFilename = rgbResourceName;
resLoader.movieAlphaFilename = alphaResourceName;
resLoader.outPath = tmpPath;
//resLoader.alwaysGenerateAdler = TRUE;

AVAnimatorMedia *media = [AVAnimatorMedia aVAnimatorMedia];
media.resourceLoader = resLoader;

self.expMedia = media;

// Frame decoder will read from generated .mvid file

AVMvidFrameDecoder *aVMvidFrameDecoder = [AVMvidFrameDecoder aVMvidFrameDecoder];
media.frameDecoder = aVMvidFrameDecoder;

// Create layer that video data will be directed into

CGRect expFrame;

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
expFrame = iPhoneExplosionRect;
} khác {
expFrame = iPadExplosionRect;
}

CALayer *layer = [CALayer layer];
layer.frame = expFrame;
}

if (FALSE) {
layer.backgroundColor = [UIColor orangeColor].CGColor;
}

[self.view.layer addSublayer:layer];

AVAnimatorLayer *animatorLayer = [AVAnimatorLayer aVAnimatorLayer:layer];

self.expAnimatorLayer = animatorLayer;

// Finally connect the media object to the layer so that rendering will be
// sent to the layer.

[animatorLayer attachMedia:media];

//media.animatorRepeatCount = 3;
//media.animatorRepeatCount = 30;
//media.animatorRepeatCount = INT_MAX;

[media prepareToAnimate];

一旦 prepareToAnimate 被命中,应用程序将在断言处失败,如下所述

** Assertion failure in -[AVMvidFrameDecoder advanceToFrame:], /Users/user/Documents/.../AVAnimator/AVMvidFrameDecoder.m:844 

...*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'framebuffer num bytes'

是我使用的架构(32 位和 64 位)导致了它还是其他原因?

我希望有人能把我带上正轨

自动对焦

câu trả lời hay nhất

我研究了这个断言以及它可能被复制的不同方式。我尝试不正确地设置 arch 标志以在可执行文件中仅包含 32 位或仅包含 64 位代码,并在 64 位设备和模拟器上进行了测试。我无法重现该问题,也不清楚它是如何发生的。为了收集更多信息,我添加了一个额外的检查,在分配帧缓冲区时以 DEBUG 或 OPT 模式编译,你能从 github 上拉出最新版本的 AVAnimator 或者从 patch here 获取补丁吗? .请确保您的代码版本中没有修改任何定义,并且您使用的是最新版本的 Xcode。

关于ios - -[AVMvidFrameDecoder advanceToFrame :] 'framebuffer num bytes' 中的 AVAnimator 断言失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32101304/

hai mươi bốn 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress