RenderHeads / UnityPlugin-AVProVideo

AVPro Video is a multi-platform Unity plugin for advanced video playback
https://www.renderheads.com/products/avpro-video/
231 stars 28 forks source link

Is it possible to play videos through a byte array instead of a file? (MediaPlayer) #1365

Open Gurwar opened 1 year ago

Gurwar commented 1 year ago

Problem description:

I am working on a project that requires encryption and decryption of videos. The current solution is to save copies of a decrypted file when they are needed for playback. This approach is very slow and obviously unsafe. I would appreciate a function in AVPro where I can pass the raw data of the decrypted video to the player instead of having to save it as a file before playback. I looked around and saw that there is infact a function of PlayVideoFromBuffer in AVPro but its Windows only. Does this function still work? Is there any chances of getting it for Android and play videos the same as we play videos by path or by reference?

Device (which devices are you having the issue with - model, OS version number):

Quest 2

Media (tell us about your videos - number of videos, resolution, codec, frame-rate, example URLs):

I am running this application on Android for the Quest 2.

System Information:

AVPro Video: v2.5.0 (plugin v2.5.0f1-ultra) Target Platform: Android Unity: v2021.3.8f1 WindowsEditor OS: Desktop - B550M DS3H AC (Gigabyte Technology Co., Ltd.) - Windows 11 (10.0.22621) 64bit - English CPU: AMD Ryzen 5 5600X 6-Core Processor - 12 threads - 32691KB GPU: NVIDIA GeForce RTX 3080 - NVIDIA - Direct3D 11.0 [level 11.1] - 10067KB - 16384

Chris-RH commented 1 year ago

Hi @Gurwar,

Its not currently possible, but is something that we could look into supporting in the future.
In the meantime, our other supported encryption methods are here: https://www.renderheads.com/content/docs/AVProVideo/articles/feature-content-protection-ultra.html

Gurwar commented 1 year ago

Thanks for the reply @Chris-RH,

Do you know of any other libraries that could be used to support such a feature?

Ste-RH commented 1 year ago

I am afraid we do not.

This is something we will look to add in the near future.

Gurwar commented 1 year ago

My team ended up using the caching feature of AV Pro to download videos locally. If your application requires internet authentication it's a good alternative to playing videos directly from the video file.