Working video playback for Windows

I’ve been trying to get video playback working for the Windows build of our game.

So far I’ve tried a fork of HaxeVLC (crashes due to memory access violations when invoking calls from the 64 bit VLC DLLs) and Openfl-ffmpeg (crashes due to what I suspect is a 32 bit ndll being used by a 64 bit application). Unfortunately, neither library seems like it will be updated anytime in the near future.

I was wondering if anyone could recommend any other video playback libraries that are actively being maintained? Preferably one that works with Haxe 3.4.7, but I’ll also consider it if it works with Haxe 4.0.

There are some people working on it.

Hi. Im the one that wrote the HaxeVLC - its quite old and not really supported at this point. So it probably wont work as is with newer OpenFL versions.

I’ve done a LibVLC based Kha player that works well - planning on bringing that over to OpenFL soon also - will probably change the repo a bit. So there is a solution for Native targets on the way…

Also - sidenote; I’m looking into an FFMPEG alterantive / Windows Media Foundation version.

1 Like

@Dimous published linc_ffmpeg a couple of years ago, you might try that.

A disclaimer perhaps, he did say at the time:

More details here.

Perhaps all we are missing are 64-bit builds of these older libraries? Does lime rebuild <library name> windows -64 work?

Running “lime rebuild HaxeVLC windows -64” didn’t seem to do anything.

Running “lime rebuild openfl-ffmpeg windows -64” did make some DLLs and put them in the hxcpp directory under bin/Windows64, but it apparently still needs a 64 bit version of openfl-ffmpeg.ndll.

Did it generate “bin/Windows64/openfl-ffmpeg.ndll”?

No NDLLs, just DLLs. Attached a screenshot of all the files it generated. Not sure why it made DLLs mysql5 and sqlite, but they’re there.

image

@singmajesty Oh, I should mention that I have tried to compile openfl-ffmpeg to get an ndll and have gone down a long rabbit hole of issues. I think the code that’s on the Github page was configured for Mac, given that it appears to be trying to include some Xcode specific libraries. So maybe that’s a factor.

I’ve since pulled down the code for various dependencies and have been poking at compiling them for Windows 64, but it’s proven to be quite the task.

If you only need windows exe, HaxeVLC seems to work after making some adjustments. But you must work with VLC’s 32-bit libraries, and compile from Haxe to windows with the -32 parameter.

I have a working version on a fork of the original:

Here is a conversation in which I clarify how I have made it work:

Remember to copy the VLC 32 libraries (+ plugins folder) to the bin folder before running the exe.

1 Like

Is there some reason why the stock movie playback features of Win32 are insufficient? Are you trying to access Codecs that are not included by MS? I know that VLC is basically a patent infringer par excellence, and i use the product myself as a consumer. But for a commercial product it does present risks.

Our team lead wants to be able to play video animations in the background of our game at certain milestones.

We’ve been working on it for over two years and our current setup makes a 64 bit build. I would prefer not to change the setup too drastically to get this feature in if possible, but I’ll explore whatever options are available.

This is a screenshot of a small game i made in Kha - its running as a windows 64 application using LibVLC as the video replacement for desktop. The background is a h264 video and the foreground elements are normal text, images, spine assets etc. I have ironed out most issues and bugs with VLC for Haxe now so i will begin working on porting this to OpenFL - Will update my HaxeVLC repo at some point - the old version - it wont work properly with newer OpenFL - and is 32 bit only :slight_smile:

3 Likes

That’s great!

Is there anything I can do to help you with this?

So - my initial test of porting the new LibVLC based player to OpenFL :

Seems to work just fine :slight_smile: - Running on latest version of OpenFL on Win 10, 64bit

5 Likes

Do you think it will support video with alpha ?
Just wondering.

Yes - I’m rendering RGB_A - meaning the alpha channel is included. So it should work fine. However; you need to use a codec that supports alpha video - H.264 does not. But the player will handle all the same formats you can play in the VLC media player.

3 Likes