Hap is a video codec which allows to decode high-resolution videos using mainly GPU power and gives ability to play videos with alpha channel transparency.
It proved to be the only one solution which managed to preserve glitch-free high-framerate video playback in our mixed reality playscape with Unity running with 8 projectors. We tried other solutions, but they just didn’t work. Finally, we made this plugin.
This plugin version has an ability to sync the video playbackacross multiple machines in a LAN network:
Main features:
— Hardware accelerated Hap video playback without any external codecs installation needed. All fravours of Hap are supported.
— Sync playback across multiple machines using UDP networking
— Use Unity Timeline to control the playback
— Control video playback with your own clock source
— Ability to manually specify current video frame index
— Texture updates are completely in background threads - main and render threads are unaffected
— Multichannel 5.1/7.1 audio support using Unity AudioSource
— High quality video with the new Hap R codec
— Low CPU usage. Frames are mostly decompressed on the GPU.
— Play 4k @ 120 fps, 8k @ 60 fps or 10k @ 60fps videos (on supported hardware), play tons of smaller videos at once. Extremely fast frame-precise seeking.
— Playback speed control.
— Transparent videos with Hap Alpha, Hap Q Alpha and Hap R codecs. First plugin to support Hap Q Alpha/Hap R in Unity.
— Chunked Hap support for even faster multi-threaded decoding.
— Works with DX11 rendering on Windows.
— Audio output through the Unity Native Audio plugin (without network syncing) and AudioSource (with netowrk syncing, multichannel audio supported).
— Preload video to memory if your SSD isn’t fast enough.
— Configurable RAM/GPU memory usage.
— Suits for both programmers and artists: C# API along with IMGUI/uGUI/Render to Material wrappers provided.
— Example scenes with the typical usage scenarios.
Requirements for this asset version: — Unity 2019 - Unity 2020 — Windows 8.1/10 — DirectX 11
Hi,
we bought the asset,
unfortunately after half a day of testing we got erratic behaviours
and both server and client did not play smootly
a resync with mouse click made it work better again till now.
We will keep on testing but could you please give some feedback/tips? maybe a resync after each loop ?
videos are 1920x1920 30 fps normal Hap (8 chunk from after effects)
the setup for each pc is two 4k screen with two cameras/canvas panel playing the same video (scaled twice),
hardware is gpu Nvidia Geforce rtx 3080 , cpu i7 10700k 3.80Ghz, nvme drive
for the test the 2 pc are cabled directly (no switch or router)
unity version is 2021.2.19
@cameranebbia If nothing of the above helps, somewhat informative thing will be to record a video (preferrably a slowmotion using iphone) of the demo app playback with all the information visible. The best is to have both computers screens on one vertical video, where one screen is located above another like below:
@cameranebbia Another thing to watch out for: make sure VSync is enabled on server/client.
Either use QualitySettings.vSyncCount = 1 (done in scripts included with the package by default) for build, or enable it in the Editor window.
This weekend I launched another test, same set up and same problem after around 10 hours, the issue is clear on the client machine, here is a video with the info resyncing and glitching (password is “test”)
the server was not smoothed but also not as bad as the client.
Again after a mouse click (but not with a space bar pause/play) the playing became smoothed
The issue appears after at least half a day, so testing will take time.
Pretty sure everything was vsynched,
I will update you and in case send project files.
Best
just read the demolition_media_hap_pro_sync_demo_app manual:
do you recommend using nvidia sorround for two display (1 video spanned across the screens)?
I’m using two display with two cameras and two canvas (cause it’s easier for frame blending)
New version 2.0.1 just published on the Asset Store: — Fixed sync stability while running for long time (several hours and more). Thanks @cameranebbia for reporting the issue in the posts above
— HAP HDR - play 16-bit per color component floating point HDR videos. Ideal for playing things like 10-bit color depth footage. Or playing back encoded ambient occlusion/arbitrary data. Unsigned format recommended. Encoding possible with TouchDesigner
— 10-15% faster decoding compared to previous release - play even more videos.
— DX12/Vulkan/OpenGL rendering supported in addition to DX11 (DX11 recommended).
— Added Unity 2022/2023 support.
— Added Linear color workflow support.
— Ability to disable all logging or INFO-level messages using by setting DEMOLITION_MEDIA_DISABLE_LOGS / DEMOLITION_MEDIA_DISABLE_INFO_LOGS define in the Project Settings
Hi. Just wanted to mention that VSync should be enabled in the Project Settings, for the plugin to work correctly! There were some cases recently where some users didn’t do so, and the playback sync was broken because of that. Thanks everyone!
I’ve just implemented a playlist functionality for SYNC Server/Client to be able to switch videos during playback. Also added an example of sending custom commands from the server to the clients + couple of other improvements. The asset store package will get updated in some time, meanwhile if you want to try it, I can send it by e-mail