2017-03-29 34 views
0
I want to change the background color for AVMutableVideoCompositionInstruction which is working fine.But in when I am using UIImage for Color Pattern its not Working ??? Please Help...here is code Image Using.also I am giving is BackgroundColor White but its not Showing it White. 

這裏是我的代碼我使用:AVMutableVideoCompositionInstruction背景使用UIImage的顏色?

AVMutableVideoCompositionInstruction *MainInstruction = [AVMutableVideoCompositionInstruction videoCompositionInstruction]; 
    MainInstruction.timeRange = CMTimeRangeMake(kCMTimeZero, asset.duration); 
    MainInstruction.layerInstructions = layerInstructionsArr; 
    UIColor *bgBlurrcolor =[UIColor colorWithPatternImage:[UIImage imageNamed:@"aa.png"]]; 
    MainInstruction.backgroundColor = bgBlurrcolor.CGColor; 

回答

0

檢查這些鏈接

只唯實BGRA顏色支持;圖案和其他支持的顏色被忽略。如果渲染的像素緩衝區沒有alpha,那麼背景顏色的alpha值將被忽略。 如果背景色爲NULL,則視頻合成器使用不透明黑色的默認背景色。

https://developer.apple.com/reference/avfoundation/avvideocompositioninstruction?language=objc

https://developer.apple.com/reference/avfoundation/avvideocompositioninstruction/1389384-backgroundcolor?language=objc