# Video file compatibility with the Unity Editor

> Discover which video files are compatible for each platform.

You can import many video file formats into Unity. Unity stores imported video files as [VideoClip](/engine/6000.0/manual/video/sources/class-video-clip.md) assets.

For Unity to preview video files, the files must be compatible with the platform where you run the Unity Editor. Your files must also be compatible with the target build platforms. Unity provides options for transcoding files to commonly supported formats, but you can also manage compatibility yourself. See [Compatibility with target platforms](#CompatibilityWithTargetPlatforms) below for more information.

## Compatibility with Editor platforms

Video source files must use a format that your Editor platform supports. Each 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       |       |       |

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 Vorbis for audio.

### WebM videos - Supported video and audio codecs

Unity usually only supports the import of WebM videos with VP8 (video) and Vorbis (audio) codecs. However, you can use the `StreamingAssets` folder to add WebM videos with the other codecs to the project. When you use this folder, the Editor doesn't interpret the file itself, instead the Editor imports the raw file into the build. For more information about this folder, refer to [Include additional files in a build](/engine/6000.0/manual/building-and-publishing/streaming-assets.md).

You can then use code to assign the raw file to the VideoPlayer component (refer to [VideoPlayer.url](/engine/6000.0/script-reference/unityengine/video/videoplayer/url.md)). This allows the target platform to read the file directly and bypass the Editor's support limitations. However, the imported video clip isn't visible in the Editor and you can't drag the asset onto a Video Player in the scene.

When you use a video file in this way, it unlocks the following target platform capabilities:

| **Platform**    | **Supported video codecs**                                                                                                                                                                     | **Supported audio codecs**                                                                                                                                                                     |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Android         | Supports the video codecs that WebM files support on Android. Refer to the Android documentation on [Supported media formats](https://developer.android.com/media/platform/supported-formats). | Supports the audio codecs that WebM files support on Android. Refer to the Android documentation on [Supported media formats](https://developer.android.com/media/platform/supported-formats). |
| Nintendo Switch | VP8, VP9                                                                                                                                                                                       | Vorbis                                                                                                                                                                                         |
| Web             | VP8, VP9                                                                                                                                                                                       | Vorbis, Opus                                                                                                                                                                                   |

## Additional resources

* [Video file compatibility with target platforms](/engine/6000.0/manual/video/sources/compatibility-target-platforms.md)
* [Transcoding video files](/engine/6000.0/manual/video/sources/transcoding.md)
* [Understand video files](/engine/6000.0/manual/video/sources/video-files.md)
* [Video transparency support](/engine/6000.0/manual/video/sources/transparency.md)
