English 中文(简体)
出口视频时使用CFBasicAnimation 标记
原标题:Animation with Custom key in CFBasicAnimation Doesn t work when exporting Video

我有一门带有多头 sp和多长时间的骨折。 因此,我要说,我有3种 sp,每部含有16个性区块,我有3秒钟。 弗拉梅南安提炼厂回家后,我随行接受筛查,顺利进行[16个框架/秒]。

我现在想以视频方式出口这一动画。 问题在于,当我随时间随时间推移而附上《基本标准》。 期限参数为t 工作,所有框架在单一二次中都有作用。

    GTAnimation *an = [[GTAnimation alloc] initWithFrame:CGRectMake(0, 0, videoSize.width, videoSize.height) withFileName:@"Host_Angry_" withSeconds:3.5];

    CALayer *animationLayer = [CALayer layer];
    animationLayer.bounds = CGRectMake(0, 0, videoSize.width, videoSize.height);
    [animationLayer addSublayer:an.animLayer];

    CABasicAnimation *fadeAnimation = [CABasicAnimation animationWithKeyPath:@"currentFrame"];
    fadeAnimation.fromValue = [NSNumber numberWithFloat:1.0];
    fadeAnimation.toValue = [NSNumber numberWithFloat:45.0];
    fadeAnimation.additive = NO;
    fadeAnimation.removedOnCompletion = NO;
    fadeAnimation.beginTime = 0.0;
    fadeAnimation.duration = 3.5;
    fadeAnimation.repeatCount = HUGE_VAL;
    fadeAnimation.fillMode = kCAFillModeBoth;
    [an.animLayer addAnimation:fadeAnimation forKey:@"currentFrame"];

    CALayer *parentLayer = [CALayer layer];
    CALayer *videoLayer = [CALayer layer];

    videoLayer.bounds = CGRectMake(0, 0, videoSize.width, videoSize.height);
    [parentLayer addSublayer:videoLayer];
    [parentLayer addSublayer:animationLayer];
    videoLayer.anchorPoint =  CGPointMake(0.5, 0.5);
    videoLayer.position = CGPointMake(CGRectGetMidX(parentLayer.bounds), CGRectGetMidY(parentLayer.bounds));
    animationLayer.anchorPoint =  CGPointMake(0.5, 0.5);
    animationLayer.position = CGPointMake(CGRectGetMidX(parentLayer.bounds), CGRectGetMidY(parentLayer.bounds));
    videoComposition.animationTool = [AVVideoCompositionCoreAnimationTool videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayer:videoLayer inLayer:parentLayer];
最佳回答

据AVideoCompositionCore Animation 称 工具类别

“任何影像都将在录像时间上解释,而不是实时,因此,你应当:

a. 设定分析开始时间财产为1e-100而不是0(核心分析用CACurrentMediatime取代);

问题回答

使用AVCore Animation Begintime AtZero不做脱硫。 开始时间=0.0;

fadeAnimation = AVCoreAnimationBeginTimeAtZero;




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签