Fixed (FIXED in 1.21.2.0) ImagePanel Cannot Play Any Local Video Files, Always Causing: "Error with video VideoPlayer cannot play url"

AlienAxeMan

Well-known member
Messages
73
Reactions
284
Points
53
Website
www.patreon.com
Patreon
AlienAxeMan
The local video player functionality for ImagePanel doesn't seem to work at all in VAM v1.21.2.0. I've tried a variety of mp4 h264 files that I've confirmed work in Unity generally, as well as inside VAM via the VideoController plugin, but every time I try to load them into an ImagePanel inside VAM (via the Browse button), I get the following type of error (differing only in path/filename):

Error with video VideoPlayer cannot play url : Custom/Videos/MyVideo.mp4

I've also tried moving the videos around to various folders, but have yet to find any setup that actually works, and even a few that caused VAM to crash upon attempting to load them.

1675372177102.png
 
Last edited:
It's been awhile since I've used personal videos in my scenes, but if I remember right you need the format to be webm. There's a few handy converters on the web if you need one.

Edit: I don't think you can use an Image Panel. You can however use a web panel and use a local URL to play a video. I've got VaM on a secondary drive so I often store the videos in the root of the drive for easy access in in-game directory browser.
 
Last edited:
It's been awhile since I've used personal videos in my scenes, but if I remember right you need the format to be webm. There's a few handy converters on the web if you need one.

Edit: I don't think you can use an Image Panel. You can however use a web panel and use a local URL to play a video. I've got VaM on a secondary drive so I often store the videos in the root of the drive for easy access in in-game directory browser.

The recent big update added direct video playback support to ImagePanel objects. It's a pretty new feature. Here's the relevant portion from the update notes:

All ImagePanel, TVs, and other props that supported images now also support video playback (avi or mp4 (H.264)). This works with streaming url, local files, or packaged files. Note that packaged files have to be extracted to temp or cache file before they can be played due to how Unity's VideoPlayer works. The caching system now supports this, so the cost is only paid once per file.
 
The recent big update added direct video playback support to ImagePanel objects. It's a pretty new feature. Here's the relevant portion from the update notes:

All ImagePanel, TVs, and other props that supported images now also support video playback (avi or mp4 (H.264)). This works with streaming url, local files, or packaged files. Note that packaged files have to be extracted to temp or cache file before they can be played due to how Unity's VideoPlayer works. The caching system now supports this, so the cost is only paid once per file.
Oh that's pretty neat. I've got two installs of VaM, and only the install I use for building is updated so I must have missed that. Thanks for the heads up! The resource cost reduction is pretty nice. I always had to avoid using video in my scenes because it was too high. That and always converting to Webm was a pain. This is great news!
 
I also had no luck playing any .avi or .mp4 files (on any panels or TVs).

same errors:
!> Error with video VideoPlayer cannot play url : Custom/2023-02-02 22-05-14.mp4
!> Error with video VideoPlayer cannot play url : Custom/2023-02-02 22-12-24.avi

I recorded multiple test files (with OBS):
-hardware or software encoding
-in .avi and .mp4 formats
-with various video settings/codecs (different h.264 options, mpeg4, msvideo,...)
-with various audio settings/codecs (aac, ac3, vorbis,...)
-without any audio or video

I even checked old Unity 2018.1 documentation for any hints.
Everything works fine outside VaM or with Virtual Home Theatre plugin. 🤷‍♂️
 
I also had no luck playing any .avi or .mp4 files (on any panels or TVs).

same errors:
!> Error with video VideoPlayer cannot play url : Custom/2023-02-02 22-05-14.mp4
!> Error with video VideoPlayer cannot play url : Custom/2023-02-02 22-12-24.avi

I recorded multiple test files (with OBS):
-hardware or software encoding
-in .avi and .mp4 formats
-with various video settings/codecs (different h.264 options, mpeg4, msvideo,...)
-with various audio settings/codecs (aac, ac3, vorbis,...)
-without any audio or video

I even checked old Unity 2018.1 documentation for any hints.
Everything works fine outside VaM or with Virtual Home Theatre plugin. 🤷‍♂️
Just tried it out myself. It seems it's hit and miss if it wants to work or not. I'm not sure the what's causing some videos to play and other not to. I tested some and the only thing I noticed is 3 of the 5 videos that didn't play were of higher resolution. However at the same time the other two where lower videos at 480p and 720p didn't want to play either, so I don't if its as simple as resolution or file size. All the files I did test were mp4. Didn't have any .avi's around to test.
 
Just tried it out myself. It seems it's hit and miss if it wants to work or not. I'm not sure the what's causing some videos to play and other not to. I tested some and the only thing I noticed is 3 of the 5 videos that didn't play were of higher resolution. However at the same time the other two where lower videos at 480p and 720p didn't want to play either, so I don't if its as simple as resolution or file size. All the files I did test were mp4. Didn't have any .avi's around to test.
Well I didn't managed to play a single one (out of ~15 some files).
File size was small, with only 3-6 sec recorded at 1920x1080p.

I didn't consider testing lower res...before uninstalling OBS. :confused:
 
Well I didn't managed to play a single one (out of ~15 some files).
File size was small, with only 3-6 sec recorded at 1920x1080p.

I didn't consider testing lower res...before uninstalling OBS. :confused:
That's really odd. Wish I could help more, but I've checked everything I can and for the life of me cannot find a correlation between the videos that didn't work. Let alone the ones that did.. Sorry. :confused:

Hopefully someone else comes along with an answer, because I'm stumped.
 
It turns out there was a bug in the video system. The fix (along with a bunch of others) will be in the next patch.
 
Hmm. While the new 1.22 fix does stop the message popping up, it still plays very few mp4 files. Either they don't show any video or audio, or they show the 1st frame and nothing, or they show the 1st frame and an endless spinning circle.

Anyone know if there has been an updated re-release of the 3rd party browser patch that is compatible with the new versions? Or is it possible to allow the new browser to use local windows codecs?

While I love a lot of what I see in 1.22, I have way too many scenes using video, so I am forced to revert to the older versions for now.
 
Hmm. While the new 1.22 fix does stop the message popping up, it still plays very few mp4 files. Either they don't show any video or audio, or they show the 1st frame and nothing, or they show the 1st frame and an endless spinning circle.

Anyone know if there has been an updated re-release of the 3rd party browser patch that is compatible with the new versions? Or is it possible to allow the new browser to use local windows codecs?

While I love a lot of what I see in 1.22, I have way too many scenes using video, so I am forced to revert to the older versions for now.
Video on image panels was not even a feature before 1.21 so I'm not sure what good that does you to use an older version. (edit: ok I see you were using the chromium hack to previously play video and the new version uses a new version of chromium and the old hack does not work).

The built-in video player can only play mp4s that are using H.264 codec and there may be some other limitations.
 
Video on image panels was not even a feature before 1.21 so I'm not sure what good that does you to use an older version. (edit: ok I see you were using the chromium hack to previously play video and the new version uses a new version of chromium and the old hack does not work).

The built-in video player can only play mp4s that are using H.264 codec and there may be some other limitations.
Yeah I was using the chromium hack before, and I understand for licencing that's probably not an option officially. I am not sure if chromium has some way to allow use of local codecs like unity itself does though, maybe that is a possibility?

Otherwise, let's hope some wizard comes along and is able to make a newer hack.
 
Video on image panels was not even a feature before 1.21 so I'm not sure what good that does you to use an older version. (edit: ok I see you were using the chromium hack to previously play video and the new version uses a new version of chromium and the old hack does not work).

The built-in video player can only play mp4s that are using H.264 codec and there may be some other limitations.

Indeed. A number of the best premium scenes depend on this. I don't think I've run into any streams yet that use local video playback but I've seen MANY which have webpanels loading phub or xhamster. I suspect the browser update is the break many really mean when they say the video player is broken.
 
I don't consider this a bug. I would guess 1% or less of VaM users even knew about the chromium hack which is not something that can be officially included as it is violating codec licenses. So if scenes were created that required that hack, most users probably just saw a web page come up with no video playing.
 
I agree, these are not really bugs, just usability issues.

The answer to ImagePanel, etc is simple though. Use unity's built-in video systems, then all local codecs will function (k-like codec pack ftw). This is an easy fix, the code to do this is on the unity api docs web site. Don't use chromium for local panels.

The answer for web browser however, is much more difficult due to dumb licensing issues. My suggestion (I don't expect you will do it though), is to either revert to the old browser until such time as chromium adds support for AV1 etc (and let people find the old hack), or possibly adjust the changes to allow the old hack to be placed over the newer version (atm it causes game freeze, likely due to some api call not responding I guess, maybe this freeze could be worked around?). Like I say, I don't expect this will happen, as I am sure you have put a hell of a lot of work into the new browser, but I do question if it is in fact an upgrade, if it lowers the quality of the experience for users. I question if anyone here even uses the browser for anything other than video site playback?

I appreciate all your hard work @meshedvr, my suggestions are just trying to find a perfect solution for your amazing sandbox.
 
Last edited:
Back
Top Bottom