小编Man*_*n S的帖子

使用AVMutableComposition合并视频时视频破解

我正在使用AVMutableComposition将视频与下面的代码合并,

- (void)MergeAndSave_internal{

    AVMutableComposition *composition = [AVMutableComposition composition];
    AVMutableCompositionTrack *compositionVideoTrack = [composition addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid];
    AVMutableCompositionTrack *compositionAudioTrack = [composition addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid];
    AVMutableVideoComposition *videoComposition = [AVMutableVideoComposition videoComposition];
    videoComposition.frameDuration = CMTimeMake(1,30);
    videoComposition.renderScale = 1.0;

    AVMutableVideoCompositionInstruction *instruction = [AVMutableVideoCompositionInstruction videoCompositionInstruction];

    AVMutableVideoCompositionLayerInstruction *layerInstruction = [AVMutableVideoCompositionLayerInstruction videoCompositionLayerInstructionWithAssetTrack:compositionVideoTrack];

    NSLog(@"%@",videoPathArray);

    float time = 0;
    CMTime startTime = kCMTimeZero;

    for (int i = 0; i<videoPathArray.count; i++) {

        AVURLAsset *sourceAsset = [AVURLAsset URLAssetWithURL:[NSURL fileURLWithPath:[videoPathArray objectAtIndex:i]] options:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey:AVURLAssetPreferPreciseDurationAndTimingKey]];

        NSError *error = nil;

        BOOL ok = NO;
        AVAssetTrack *sourceVideoTrack = …
Run Code Online (Sandbox Code Playgroud)

video objective-c ios avmutablecomposition avassetexportsession

4
推荐指数
1
解决办法
502
查看次数

iOS 9应用程序MultiTasking中的提交问题需要所有方向

我正在使用Xcode 7将我的应用程序推送到应用程序商店,我的应用程序适用于iPhone和iPad.但它只支持肖像和风景.

这是我的错误:

在此输入图像描述

如何仅以纵向和横向方式提交具有特定方向的应用程序.

有什么建议可以解决这个问题?

objective-c app-store ios xcode7

2
推荐指数
1
解决办法
2001
查看次数