Hey everyone I am cropping a video taken from the camera on iPhone and then cropping it an playing it back like this. When i do it however I get a weird green line around th
The answer by @Rhythmic saved my day.
In my app, I need square video as per screen width size. So for iPhone 5 this comes 320 pixels and for iPhone 6 this becomes 375 pixels.
So I came across same green line issue for iPhone 6 size resolution. Because its screen size width is 375 pixels. And not divisible by 2 or 4.
To come out of this we made these changes
AVMutableVideoComposition *MainCompositionInst = [AVMutableVideoComposition videoComposition];
MainCompositionInst.instructions = [NSArray arrayWithObject:MainInstruction];
MainInstruction.timeRange = range;
MainCompositionInst.frameDuration = VideoFrameDuration; //Constants
MainCompositionInst.renderScale = VideoRenderScale; //Constants
if ((int)SCREEN_WIDTH % 2 == 0)
MainCompositionInst.renderSize = CGSizeMake(SCREEN_WIDTH, SCREEN_WIDTH);
else // This does the trick
MainCompositionInst.renderSize = CGSizeMake(SCREEN_WIDTH+1, SCREEN_WIDTH+1);
Hope This helps. Just add one more pixel to it so it becomes divisible by 2 or 4.
Thanks