Search code examples
iosavfoundationavassetexportsessionavmutablecompositionavasset

AVAssetExportSession giving me a green border on right and bottom of output video


Here's the code:

AVAssetExportSession *exporter = [[AVAssetExportSession alloc] initWithAsset:mixComposition presetName:AVAssetExportPresetHighestQuality];
        exporter.outputURL = outputUrl;
        exporter.outputFileType = AVFileTypeQuickTimeMovie;
        exporter.videoComposition = mainComposition;
        exporter.shouldOptimizeForNetworkUse = YES;
        [exporter exportAsynchronouslyWithCompletionHandler:^{
            //completion
        }];

I've tried different quality settings. I always get a 1-2 pixel border running down the right side of the video and along the bottom, no matter what video I'm trying to render. What could be causing this and how do I fix it?

EDIT: I am not using any kind of green color anywhere, so this must be coming from the framework somehow.


Solution

  • Usually green lines appear after video cropping, problem is in video renderSize width, it should be multiply of 16.

    Here some links about this: apple 1 apple 2