There are surprisingly few movie file formats that can contain alpha and are supported by the native video decoding libraries on the various Unity editor/runtime platforms.
몇가지 알파채널을 지원하는 비디오가 있다는 말 같습니다.
Furthermore, to get a full understanding on what to do in order to get clips with transparency in various contexts, you must realize the implication of choosing whether you ask Unity to transcode your clips or not:
If you choose to transcode the clip, Unity uses an internal layout that makes transparency work across the board, for both VP8 and H.264, which are the two video codecs the VideoClip importer knows how to transcode into.
If you choose not to transcode, it means you know the target platform(s) will natively support the clip’s original format. You save time but it is up to you to verify the clip works as expected.
투명을 지원하는 코덱
퀵타임으로 만든건 무겁지만 퀄리티가 좋다…이런 얘긴것 같습니다.
You can author movie files that use the Apple ProRes 4444 codec using applications found here: https://support.apple.com/en-us/HT200321
Webm VP8 with alpha
v8알파채널을 많은 어플리케이션이 지원하지 않는데 ffmpeg가 가능하게 해준다고 합니다.
유니티는 비디오클립 임포터 keep alpha옵션으로 알파채널을 유지하는 기능을 제공합니다.
An exampleSo you can go ahead right now and download this clip in Unity on any editor platform: https://simpl.info/videoalpha/video/dancer1.webm
드래그해서 다운 받은 영상을 assets폴더에 넣고 scene화면에 트랜스코딩 없이 사용할 수 있습니다.
You can even just put the URL in the VideoPlayer Component’s URL field (after you have set its Source popup to URL) and you’ll be playing it from the web without needing to create an asset.
Now, if you decide you target a platform that cannot read webm with transparency (e.g.: Android’s hardware decoder does not support vp8 with alpha), what you can do instead is transcode. Go to the VideoClip importer for this movie file, enable “Keep Alpha”, enable “Transcode”, hit “Apply” and the resulting clip can then be used, with transparency fully working, in the VideoPlayer on any target platform. The downside to this method is that transcoding in Unity takes time and is currently not interruptible. Both of these aspects will be addressed later on.
안드로이드는 vp8알파채널을 지원하지 않기때문에 transcode를 사용해야 합니다.
Converting with ffmpegIf for some reason you have movie files that have transparency but are in a format that is not supported by Unity, you can use an external tool such as ffmpeg (https://ffmpeg.org) to convert into any of the Unity-supported movie file formats that can include transparency. ffmpeg supports reading and writing a broad range of file types so it is a good fit for this task. It is not an easy tool to figure out, however, but there is plenty of examples available on the web when you search for “how do you do xyz with ffmpeg”. Be ready for some command-line action, though.
To convert a movie that you know has transparency into a webm with vp8 and alpha:
This is just a startSo, as you can see, the topic of movie files with alpha is not a simple one but hopefully with this background and instructions, you’ll be able to get going. Hopefully, as we gather feedback, we’ll be able to streamline this process so it’s more automatic and leaves less chance to mistakes and uncertainties.
Hope this helps!
A/V developer at Unity