You can import different video file formats into Unity. For Unity to preview video files, the files must be compatible with the platform where you run the Unity Editor. Different platforms support different video file formats.
Note: Your files must also be compatible with the target build platforms for your users. Unity provides options for transcoding video files to commonly supported formats, but you can also manage compatibility yourself.
Each Editor platform supports different video file formats.
Extension | Windows | macOS | Linux |
---|---|---|---|
.asf | X | ||
.avi | X | ||
.dv | X | X | |
.m4v | X | X | |
.mov | X | X | |
.mp4 | X | X | |
.mpg | X | X | |
.mpeg | X | X | |
.ogv | X | X | X |
.vp8 | X | X | X |
.webm | X | X | X |
.wmv | X |
Encoding must use a supported codec. Each platform supports specific codecs that can change with each version of the platform. Video files that use unsupported codecs trigger an error message in the Editor and you must convert them to a compatible codec before you can use them. For more information about codec support, refer to the official platform documentation for your Editor, such as Windows codec compatibility and macOS codec compatibility.
The optimal supported video codec for most platforms is H.264. However, the optimal encoding for Linux is a .webm container with VP8 for video and Vorbix for audio.
The easiest way to ensure video compatibility for different platforms is to enable transcoding in Unity, which will re-encode the video for compatibility when you make a build. However, this can result in longer build times and lower video quality. To transcode video clips, refer to Video Clip Importer.
To use video clips that aren’t supported by the Editor platform but are supported by your target platform, refer to Use unsupported video files in the Editor.
Did you find this page useful? Please give it a rating:
Thanks for rating this page!
What kind of problem would you like to report?
Thanks for letting us know! This page has been marked for review based on your feedback.
If you have time, you can provide more information to help us fix the problem faster.
Provide more information
You've told us this page needs code samples. If you'd like to help us further, you could provide a code sample, or tell us about what kind of code sample you'd like to see:
You've told us there are code samples on this page which don't work. If you know how to fix it, or have something better we could use instead, please let us know:
You've told us there is information missing from this page. Please tell us more about what's missing:
You've told us there is incorrect information on this page. If you know what we should change to make it correct, please tell us:
You've told us this page has unclear or confusing information. Please tell us more about what you found unclear or confusing, or let us know how we could make it clearer:
You've told us there is a spelling or grammar error on this page. Please tell us what's wrong:
You've told us this page has a problem. Please tell us more about what's wrong:
Thank you for helping to make the Unity documentation better!
Your feedback has been submitted as a ticket for our documentation team to review.
We are not able to reply to every ticket submitted.