Integrating the Bink video codec

Has anyone tried getting Bink to work in Unity? Jeff over at RAD says that it’s easy to do through a C# script that imports the Bink DLL, but I’m still a bit fuzzy on how to do that. I figure I’ll give it a try anyway, but if anyone here has any advice, that would be fantastic.

Thanks

2 Answers

2

I haven’t used it, but if its anything like any other DLL, then you shouldn’t have to do much. Import the DLL into Unity and put it in the plugins folder so its compiled first. Then in your C# script, just import the namespace associated with the DLL.

using Bink;
//I don't know if that's the namespace.  You'll have to check it out yourself in the DLL

//Rest of your code.  You can make helper functions if you want to do 
//most of the work from js.

That’s assuming that the library works with Unity, which I have never tried.

Thanks for the tip. I plan on trying this out within the next few days...

After messing with it a bit, I notice that there doesn't seem to be a namespace associated with the DLL... It's just a bunch of global functions and typedefs. And for that matter, I don't really know how to represent some of the parameters from the C++ function signatures in C# (like LPDIRECT3DDEVICE9). I'm gonna go on ahead and declare myself stumped for the time being...

Did you get any further with this? I'm interested in using it as well, but am also no expert on C++ or C#

Unfortunately, no. I talked some more with the folks at RAD and, if anything, they led me to believe it's not currently possible after all. That is, unless you grab the Unity source code and implement Bink into that yourself... But, come on now. This wouldn't even be an issue if Unity just had the ability to import alpha channels from video files. That seems more likely to happen than getting Bink in Unity.

/deleted spam/

A question on how to optimize memory usage will never be outdated. Plus, it is one of the top results in google when looking for this problem.