Can't add pixelBufferAttributes to SKVideoNode. Any alternative for making video with transparency on ARKit?

Hi,

My goal is to present animated 2D characters with ARKit. The characters are animated in a video file. In order to do so I need to give the video a chroma-key effect so that the background will disappear and the presented video will not be rectangular and will show only the characters.

I'm using a filter and an AVVideoComposition to make all the pixels in the video that match the background hue alpha=0.

When displaying a video file with AVPlayerLayer I can set it with pixelBufferAttributes in order to make all the pixels with alpha=0 to be transparent. However, when displaying the video with SKVideoNode I can't set pixelBufferAttributes.


Any idea how I can achieve the same effect in a different way?


For anyone interested, some of the code and screenshots from my app can be found in my much more detailed question in stackoverflow:

https://stackoverflow.com/questions/50139146/arkit-spritekit-set-pixelbufferattributes-to-skvideonode-or-make-transparent