Unity Video Capture

There once was a Unity Engine roadmap without any means of capturing video or audio, conclusion: If you wanna do it right do it yourself or hope unity implements it themselves.. w00t v3.5 ๐Ÿ™‚ well anyway before 3.5 my little plugin named Video Grabber was born…

Built on the basis of OpenFrameworks (being one of the frameworks to handle video for windows & mac at the same time) and also allowing for alot more fun.
I successfully built this library as a plugin into Unity. In doing this I can now capture pixels from the camera and transfer them to a texture in a scene. I even added in some face recognition to the whole shebang…
It works quite well with a slight delay of a few milliseconds, but who really cares about that. BTW oF is doing some really cool stuff ๐Ÿ™‚

So what happens when you’ve almost finished a functioning Video Grabber (except for a couple of problems when stopping the plugin) you find out that Unity is going to implement it themselves.. of course.. Unity wouldn’t be Unity if they didn’t.. you need video we’ll put it right in there, how about some audio as well then.. whut? you want AI pathfinding… sure no problem. While we’re at it we’ll mix in a little UI update and some extra goodies… What can we expect in version 4.0? A “Generate AAA Game Concept” buttonรขโ€žยข all ready and waiting?

One thing’s for sure.. I’ve temporarily stopped working on my Video plugin with high expectations of Unity 3.5 coming.. ๐Ÿ™‚
[insert plea to beta group owner for a membership here with a cherry on top]

If your interested in looking at what I’ve currently got for video grabbing add a comment below make sure to add your email address in the proper field (which will stay private) i’ll add you to the private repo and we maybe could start an open source project for the community. ๐Ÿ™‚


11 thoughts on “Unity Video Capture”

  1. Hey there.. I know that Unity has come up with the Webcam feature, but you have done here is pretty interesting in another sense as well for me.. Using openframeworks as a plugin inside unity..
    if it is not a problem, I would like to understand how you have done this? It is something that I am starting to look into, and I would like to have some pointers as to how you went about doing this.. Were there any special considerations when you built the oF dlls, or when you exposed the functions to Unity?

    Thanks! and good work on this!!

    1. Hi Akshay,

      Yes, I have indeed built the oF library for Unity and I hit a few rough spots along the way. oF has its own way of running “apps” in its main loop and because of that I kinda stopped the development. I found a method of running oF without a window which worked fine. I only had to kill unity each time i ran the plugin as it would not stop it’s loop and i didn’t have the time to dissect that. Best way to go about building it is just get familiar with plugins and c++ build the library and create some kind of a wrapper with the needed functions. One thing i also got stuck on was the conversion of strings between Unity and the C plugin as there is no datatype for that just char arrays i guess… I think i’d need to look into it some more… non the less your questions are welcome ๐Ÿ™‚

  2. I’m currently experimenting with webcams in unity 3.5 and I’m looking for a way to record the input at the same time as using it in-game. I’d be very interested to see where you’ve got to!

    1. Interesting issue, I’ve tried to get the webcam texture as a RenderTexture but that didn’t workout it would be possible to write the pixel data out each frame to a file but turning that into a video stream is a bit harder, writing each frame to a file seems like the most logical thing to do even though it probably wont be fast.. (keeping the camera resolution small will help)

    1. Did you find the way to solve your question? I have the same needs now. I have a web player application and need the way to save a video to ost it for youtube. and i didn`t found the way yet.

  3. Hi, can you provide any specific details about building oF project as plugin? It wold be very useful! Thanks.

  4. I am def. interested in this project. I am trying to implement the ability to allow the player to record and save a short video of their gameplay and share that with another player through the game itself. If this is possible with your software/plugin, please let me know.


  5. Hi IKriz, i m really interessed in see how you make a of application inside Unity. Please could you send me the private repo. Thanks Josรƒยฉ

Leave a Reply to Yan Cancel reply

Your email address will not be published. Required fields are marked *