Professional Audio Visual Plugin for Unity
AV Pro Windows Media™
“AVPro Windows Media” is a plugin for Unity that delivers fast, smooth, high quality HD playback of all supported DirectShow™ media.
The plugin is optimised for high performance on both DirectX and OpenGL. Transparent movies supported, MJPEG and DV for video scrubbing. Dynamic loading of files from disk. Easy to use drag 'n' drop components.
The plugin is aimed at the high-end user group that require video playback features beyond Unity’s built-in video support.
a) Alpha / Transparency Support
The plugin supports video codecs that support an alpha channel, allowing playback of transparent videos - something that Unity’s native Ogg Theora codec doesn’t allow.
Codecs with alpha channel support include:
- Lagarith
- Uncompressed 32-bit AVI
b) Dynamic File Loading
The plugin supports loading files directly from the file system. This allows content to be replaced and updated without relying on having Unity installed. This is especially useful when creating an application that must be maintained/updated by a third party, or for live applications where content is being created while the application is running.
Another benefit of loading dynamically instead of importing into Unity is the time it takes to import assets. If you have a lot of video content, importing the assets can take a very long time. In this case, loading them dynamically provides a much better workflow.
c) Video Codec Choice
Video codecs can be chosen to suit the content and playback requirements. For example:
- Lossless encoding can be used for videos that require high fidelity. The Largarith codec supports lossless encoding.
- The Largarith codec can be used for videos with tranparency.
- DV / Motion JPEG or similar non-intra-frame codecs can be used when videos need to to scrubbed through, played backwards or seeked quickly (eg VJing).
d) Fast Playback of Full HD 1080p Content
The plugin has been optimised to run as fast as possible to allow for smooth playback of HD content. Various methods have been used to achieve optimal performance. These include:
- Fast OpenGL Rendering Path Using direct GPU hardware updates, the plugin is able to render very quickly using little CPU power. This path is only available when Unity is running in OpenGL mode. You can run your Unity editor in OpenGL mode by adding the “-force-opengl” switch to the shortcut. Builds can also be forced to run in OpenGL mode by using the “-force-opengl” switch on the generated executable files.
- Fast DirectX Rendering Path The DirectX rendering path isn’t as fast as the OpenGL path however we have made it as fast as possible using various techniques. Power-of-2 sized textures are used for texture updates as Unity updates these much quicker. Note: using the DirectX path a 1280x720 video will use use a 2048x1024 texture, as will a 1920x1080 video, so there is often not much difference between them in terms of system load.
- Timely Video Updates Videos are only updated when a new video frame is ready instead of every frame.
- Native Pixel Formats The plugin can use RGBA or the native YUV pixel format for GPU texture uploads. Using the YUV format we can decrease the video frame size by half. Conversion from native pixel formats to standard RGBA is done on the GPU via a shader.
e) Unity Integration
The “AVPro Windows Media” plugin provides an API for playing DirectShow content. Addionally some helpful Unity components have been created to allow drag and drop use of the plugin without any scripting. See the “Usage” section below.
f) Other
- Play multiple DirectShow videos simultaneously.
- Audio volume control.
- Seeking.
- Playback rate control.
AVPro Windows Media comes with full documentation which is also available online: PDF,
Download via the Unity Asset Store.
A Windows PC demo is available for download here:
Demo including 1080p HD sample video (10MB)
Note: The correct codecs must be installed on the system.
