Closed kkukshtel closed 5 years ago
Thank you for reporting the issue. Actually, I have never used the chunk feature with HAP. So I'm not sure what happened in it... I think it's related to the threaded uncompressing method that hasn't been implemented for the plugin yet.
I'll look into it. At least I should fix the crash.
Just curious, what's the motivation for using the chunk feature? Is it actually effective in some applications?
I tried fixing the issue. Please replace KlakHap.dll
in your project directory with the following file and check if it works.
Although the issue was fixed, it hasn't been threaded yet. There is no merit for using chunks at the moment.
Thanks for getting back! I'll try this fix out today.
With regards to chunks, we needed them for a project that we used HAP on and needed to render ~12 2K videos at a time. Setting a chunk amount resulted in a more performant scene for us vs. non-chunked encodes.
For this reason we used AVProVideo, as it currently supports this (Section 4.6.3). Would definitely love to see your player support it as well!
KlakHap uses one thread per one decoder. So if you're playing 12 2K videos at a time, it utilizes multiple cores up to 12 cores. If you have more than 12 cores on your system, it might be better to use chunks.
Oh interesting. I'm assuming here one decoder = one Monobehavior component? I haven't stress tested KlakHap against AVPro considering this — would be interesting to see!
The fix was merged in the latest release.
I'm closing this issue. Please feel free to reopen for further issues or questions.
Just tested out the HAP player. Was using this command to encode videos:
ffmpeg -i "C:\Users\kyle\Desktop\working folder\keijiro-dk-test\Assets\Depthkit\Examples\Clips\Julianne\Julianne.mp4" -codec:v hap -format hap -chunks 8 "C:\Users\kyle\Desktop\working folder\keijiro-dk-test\Assets\StreamingAssets\Julianne.mov"
Unity kept crashing on start. I traced the issue to the DLL but obviously couldn't peek inside of it. I tried different encode presets and eventually found that the same command worked as long as I didn't specify chunk amount:
ffmpeg -i "C:\Users\kyle\Desktop\working folder\keijiro-dk-test\Assets\Depthkit\Examples\Clips\Julianne\Julianne.mp4" -codec:v hap -format hap "C:\Users\kyle\Desktop\working folder\keijiro-dk-test\Assets\StreamingAssets\Julianne1.mov"
Would love chunk support as to better control video decoding!