Forums » Community Projects

Wanted. Computer Overlay plugin

Oct 08, 2013 vskye link
I was watching some of the videos on youtube from RED today and noticed this one:
https://www.youtube.com/watch?v=EsLtwhWlvL8

Anyone have this available?
Oct 08, 2013 TheRedSpy link
It's not what you think it is. You can't do an overlay video just casually you have to setup specifically with the purpose of doing it and the actual effect is post-production; you can't watch the overlay in real time you have to compile a seperate video, time-sync it and alpha overlay it over the VO footage.

It's a custom linux capture program written by mr_spuck. I'm not in the business of releasing custom software written for me for free, that's up to spuck if he wants to post it here. Usually he posts his VO stuff on his official VO plugins page but in this case he hasn't posted it.

Would be nice if somebody did make an overlay plugin that worked in the game, but we didn't know how to do it at the time without using external software, so that's what we did.
Oct 09, 2013 draugath link
I recently had an epiphany about how it could possibly be accomplished. If you hook the k_any callback on the HUD's dialog, you should be able to change the parameters of other controls on-screen. This only really came about because of my recent work on my prototype MDI. Just make sure that you save the original k_any and pass all arguments along to it, since that's where the keybind handling is done.
Oct 09, 2013 TheRedSpy link
how do you find the original k_any function? nobody ever told me where you pull these functions from to write your hooks.
Oct 09, 2013 mr_spuck link
print(iup.GetAttributes(HUD.dlg)) shows what functions are attached to the hud for example.. there are also table browsers and stuff floating around that probably let you inspect that too.. never get around to check them out though.

It doesn't look like there's a k_any function attached to the hud dialog. I think ship controls work like this.. whenever the hud gets focus it does a Game.SetInputMode(1) which seems to make game handle input directly instead of going through iup.. when another dialog pops up it reverts back to normal.

I tried a few things to get the keys but couldn't come up with anything decent. Creating the overlay seperately also has advantages. It doesn't obscure the view and there's very little overhead while playing.

TRS actually makes my thingy sound fancier than it is... It's just a keylogger and a tool that can render the output into an image sequence. It probably only runs under linux. I've wanted to put it up a while ago but then forgot. When I can figure out how it worked again I'll do so.
Oct 09, 2013 TheRedSpy link
TRS actually makes my thingy sound fancier than it is...

It's damn fancy and you know it! You can even do the mouse clicks and set custom pictures to represent the keys. How fancy is that! The only way it could be more fancy is with a GUI, but we all know that's not how we fly in linux land.

Anyway I originally was after a program that ran as an overlay in that regard but still as as separate program to VO but there's no guarantee that if you do use a program that behaves in that way that your recording software will pick it up. We could have potentially gone to all the trouble of creating a third party overlay program only to find out that GLC wouldn't record it along with the game; back to square one.

This approach is not as user friendly but the post production for videos is often tricky anyway (especially on linux) so its not so much extra work.

The youtube thingy was always meant to be about producing good quality game youtube vids entirely with free software, so the approach we took to achieve that is probably going to present roadblocks to the average user just giving it a go and making a combat tutorial.

I realise that's not the answer that anybody wants to hear, but honestly if you want this kind of functionality in a more user friendly manner there are two avenues to pursue:

1) Have the devs shed some light on how this could be achieved with a plugin/add it as a feature in VO

2) find/write recording software that will let you overlay images according to keystrokes. It could be done for linux for instance as a fork of GLC or a module of some description.
Oct 09, 2013 mr_spuck link
http://kitchen.nfshost.com/ven/keyoverlay.tar.gz

The programs are called keylogger and compose. They are written in bad C, require X and ImageMagick. Binaries are included but those probably won't run on a lot of other distros... to recompile them do "make clean && make".

I don't have the overlay images that TRS made. So it comes with mine (they are cooler anyway! http://www.youtube.com/watch?v=TDHOiimiRkA). Maybe TRS can put up his for people with less refined taste.

To create your own overlay replace images/bg.png with one that shows the unpressed state of the keys (or leave it blank) and <key name>.png with each possible key. All images should have the same dimensions. Smaller images will make the compose process run much faster.

..and usage instructions .. I hope I this makes sense:

open two terminals
terminal 1:
tar -xf keyoverlay.tar.gz
cd keyoverlay
./keylogger

terminal 2:
cd ~/.vendetta
glc -o bla.glc ./vendetta

hit shift-f8
do stuff
hit shift-f8
convert bla.glc to something useful see: https://wiki.archlinux.org/index.php/GLC#Encoding

terminal 1:
hit ctrl-c
mkdir out
./compose out=out/
ffmpeg -r 30 -i out/%05d.png -pix_fmt rgb32 -vcodec png -r 30 bla.mov <- could be that some parameters can be left out

load bla.mov and converted glc file into kdenlive
put them into two video tracks and add composite transition
check if everything looks ok then render video

I guess in theory all the steps could be automated.. but it's not like this is done all that often ..so whatever
Oct 09, 2013 draugath link
spuck, the DevKit plugin's table viewer will also read IUP structures and let you traverse them and look at the return vales from iup.GetAttribtutes()
Oct 09, 2013 vskye link
Lots of good info, thanks everyone.

TRS, I really like the quality of videos you've done under Linux. Would you care to share exactly what you are using in both software and hardware?

I'm in the process of buiding a new system, just waiting on purchasing a new power supply and some ecc ram, and perhaps upgrading to a newer video card.
Oct 09, 2013 mr_spuck link
yup .. something like that
Oct 09, 2013 vskye link
I don't have the overlay images that TRS made. So it comes with mine (they are cooler anyway!

Lol, awesome stuff. Thanks for the link also. :)
Oct 10, 2013 TheRedSpy link
Those with less refined tastes in keyboard overlay images can go here and get a scaleable Inkscape SVG. You can use that in splice it up into the relevant key and background images. Of course I can in no way endorse use of my images as spuck's are clearly superior, you should use his unless it is absolutely necessary that you use mine.

Relevant Hardware

Intel Core i7 pre sandy bridge CPU
12GB of DDR3 RAM
Nvidia GTX 260
Dual 7200RPM 500GB & 1TB Hard disks <- very important you have two

Relevant Software

Arch Linux 64bit OS

GLC
Used for recording
I use a custom script to launch VO which I just run from my home folder

cd .vendetta
LC_ALL=C LD_LIBRARY_PATH=/path/to/second/hard/disk:. glc-capture -i --capture='back' -o /path/to/second/hard/disk/Rec-%day%-%month%.glc ./update.rlb

FFMPEG
Used for exporting recorded files

glc-play nameofrecording.glc -o - -a 1 | ffmpeg -i - -y -strict -2 audio.mp4
glc-play nameofrecording.glc -o - -y 1 | ffmpeg -i - -y video.mp4
ffmpeg -i audio.mp4 -strict -2 -i video.mp4 -strict -2 result.mp4

First line exports audio to audio mp4, second to video mp4 and the final script combines. The final line may not be necessary or should even be avoided. Sometimes you dont get perfectly synced audio so you might as well combine them in your editor because you have to use an audio sync technique to get the video/audio lined up

Kdenlive
Used for editing the videos

Has all the transitions and effects I used in my videos. Takes some practice to get used to using it and is still in beta so has some stability issues. Some builds would simply not work and I had to wait for a new build before I could continue production so once you have a stable build that works I'd consider staying with that unless you know you wont need to go for new videos for a while

Inkscape
Editing and production of associated images

All my logos/graphics/banners and other video image assets were created with Inkscape including obviously those keyboard overlay graphics.

Audacity
Recording/editing voiceovers and other sounds

Anything I couldn't edit direct with the Kdenlive editor in terms of audio I did in Audacity. Mostly the voiceovers for my kick-starter video.

I should note it is possible if you build the right box to be able to do HD live-streams of VO to twitch TV using on the fly encoding there are tutorials on the web you can find about live-streaming with GLC. That is where I was going to go with it next except I require a hardware update or a separate streaming box in order to do that.
Oct 10, 2013 TheRedSpy link
Oh I found a solution to the audio sync problem I was having on that glc page on the arch wiki under 'mixing audio streams'.

Dat arch wiki
Oct 10, 2013 vskye link
Awesome, thanks TRS!

Looks like my video card is good enough, has a Nvidia GT 520.

The rest of the build has a SuperMicro mb, Xeon E3-1230 v2. I'll be putting in 32MB of DDR 3 ECC ram, that I should be ordering within a month or two. I have 16GB or normal non-ECC ram I have laying around that I'll be using in the mean time. (matched set)

Power supply, sigh .. I have 2 of them here, but both won't work with the new mb, which requires ATX12V & EPS12V. I'll pick that up next week.

Hasn't installed Arch in a bit, but I think I'll just go that route again since I'm not really liking the *Ubuntu based stuff so much lately.