View Full Version : Can AviSynth overlay ODBII data onto the video?
gte024h
9th April 2008, 02:07
I am pretty familiar with writing AviSynth scripts for various ripping needs, but now I have a new challenge. I have some in-car DV footage from my last auto sport event and I also have data from an ODBII data logger. Is there a way to overlay the data onto the footage? Showing speedometer readings in the corner would be start. I would love to find a way to animate a gauge instead of plain text, but I'll take what I can get.
I was considering using the Animate() function, but I haven't quite figured it out. I suppose I could generate bitmaps for 0MPH though 120MPH gauges, then use a conditional statement to overlay the right bitmap based on the data. Not sure what software (other than photoshop) I could use to make the gauges though.
I appreciate everyone's suggestions!
http://parametric.org/~gte024h/road_atlanta1.jpg
Car #86 at Road Atlanta... yeah, that's me :)
Gerard V
9th April 2008, 02:42
Just an idea. Instead of a gauge in the shpe of an arc like a typical one, it might be easier to use a stright line like an LED VU meter scale. Have, say, 15 marks verically (in photoshop) labelled 10 km, 20km etc to 150km (or whatever) to create a scale and overlay that on the video. Then you only need to animate a pointer or bar which gets shorter or longer accordingly. The bar could be a simple single colour frame of, say, 20px wide by speed-px height and overlayed next onto the main pic next to the linear scale.
gte024h
9th April 2008, 02:48
Has that been done before by anyone here? It would be nice if there were some example scripts on the Wiki so that I would have something to get started with.
I was thinking also about using an animation program to animate a full pseudo-dash against a chroma-key. I think I saw an AviSynth function for overlaying two clips using a green screen for transparency... Now I just need to learn how to use an animation program ;)
Edit: I was just reading the Overlay() description on the Wiki and it mentions not using it for interlaced material. My DV cam is NTSC only so fully interlaced is my only option. This could complicate things...
Blue_MiSfit
9th April 2008, 03:20
Not such a big deal if you bob-deinterlace the video to 60p first, and then overlay the graph. Or you can do it in 30p, which is probably a more frequently used option.
You're going to have to deinterlace at some point.. :)
~MiSfit
IanB
9th April 2008, 03:47
Print your ODBII channel data to text files suitable for use with ConditionalReader() and use FrameEvaluate() to do whatever with the values.
I suggest you start with just using SubTitle() to get the values infrastructure aligned timewise, then start in manipulating some heavier duty script to provide a nice visual effect.
To do an active gauge you could paint up a clip with a frame for each value and FrameEvaluate() an appropriate Trim() into an Overlay().
Or you could abuse Stickboys (JDL Utils) RemapFramesSimple() to do a similar thing but printing your ODBII channel data out in a format for RemapFrames...
thetoof
9th April 2008, 06:32
The first thing that comes in mind is Aegisub... it can do many interesting things with \p1 and \t, just to name a few. All the documentation and the program is here (http://www.malakith.net/aegiwiki/Main_Page). Look for ASSDraw3 (inside Aegisub) for vectorial drawing. Then, with a simple Textsub() at the very end of the script, you can add it to your video.
gte024h
9th April 2008, 23:58
Thanks for the great ideas. I'll make sure to post some results on YouTube when I figure it all out.
lamer_de
10th April 2008, 00:43
using textsub might be a good idea if you just want to have the numbers on screen, but it would be insane to do anything graphical with it (especially as the graphic needs to be modified on a per-frame basis).
What IanB said should work out nicely, just create lots of pictures (where you can also use transparency) with a gauge in the needed positions (the amount of pictures depending on the precision you need) and overlay them based on the data.
thetoof
10th April 2008, 01:07
Actually, the aegisub tags I mentioned can animate pretty much everything. I used it to simulate a RPG battle (ATB, life decrease on gauges, bouncing damages, misses and blocks, animated attack names, etc. etc.) and it wasn't that long to program. It all depends on what you're more used to do in terms of programming (images or animated subs+vectorial drawing)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.