- Home /
How to integrate a video with alpha channel (rgb+alpha) in the new 5.6 videoplayer?
I would like to integrate videos with an alpha channel into my project. I'm streaming the videos from my harddrive using the new videoplayer from the 5.6 beta. Currently I'm using the particle/additive shader as a workaround instead of an alpha. Is it currently possible to integrate an video with alpha channel (rgb+alpha)? Which format is supported?
Answer by djsegler · Sep 14, 2017 at 01:19 AM
Did this ever get resolved? Trying out the new VideoPlayer component and not able to get transparency to work correctly. Followed the instructions here: https://docs.unity3d.com/Manual/VideoTransparency.html that prescribes that the video clip with alpha needs to be encoded with ProRes 4444 or VP8. I used ProRes 4444 and I can see the video with alpha correctly in the preview window, but in the game view, the transparent regions still render as black.
What am I missing?
2017.1.1f1
Thanks!
Everyone,
I've discovered the problem. Aside from properly encoding the footage before import, it's also necessary to select the "Sprites-Default" material in the $$anonymous$$esh Renderer component. Otherwise, the transparency isn't recognized.
Unity $$anonymous$$m - would you be willing to update the documentation to highlight this? $$anonymous$$aybe it's obvious for some, but wasn't for me!
Thanks!
Answer by MrMatthias · Jan 26, 2017 at 01:52 PM
No. you have to put the alpha channel into the video. so you have a video with color on the left and black/white alpha mask on the right. Then you can write a shader that samples the texture for the alpha value.
Answer by BlaineBrezina · Jun 12, 2017 at 08:44 AM
Sorry to necro a thread but for anyone who passes through here looking for answers.
It is possible to do this. Unity prefers H.264 and Webm VP8 formats for video formats with alpha it seems. Also would suggest overriding the encoding to H.264. It may take a while for unity to apply this import setting but it is a file format that is supported across a wider variety of devices (including android). More info here: https://forum.unity3d.com/threads/settings-for-importing-a-video-with-an-alpha-channel.457657/#post-2971240
I found that using the Unlit/Transparent Cutout shader on the renderer object (Object you are rendering video on) works wonders with alpha'ed video, as long as you don't need the video to react to lights in you scene.
Answer by this-play · Jul 04, 2017 at 02:53 PM
Hi guys,
we exported the footage as uncompressed AVI with RGBA, then used this encoder, since the transcoding method utilizing ffmpeg in this thread did not work for us. But you have to install the direct show filter nevertheless.
the videoplayer displays the footage correctly with alpha channel, but just in the preview. If we make a build the texture is just white.
Answer by kordou · Mar 20, 2018 at 06:52 AM
hi
i also have a problem with transparency. I have made a .webm transparent video with ffmpeg and VP8. I tried out of unity app and the transparency works for pc and android.
I tried to simple play it as a link with the 5.6 videoplayer (URL) but i get the green screen on my video (does not read the alpha value)
i tried to transcode and then played as a link (i upload the transcoded file) but still getting the green screen
i tried it with easymovie texture but still the same
any ideas about how to solve this ?
Your answer
Follow this Question
Related Questions
Handheld.PlayFullScreenMovie in iOS is faulty? 0 Answers
play back 360 video STEREO on GearVR 1 Answer
VideoPlayer streaming and buffering 0 Answers
MovieTexture.duration is giving me the wrong time. 1 Answer
Is it possible to access a file from the android Internal storage on to a Unity app during run time? 0 Answers