|
Registered Member
Join Date: Mar 2004
Posts: 31
|
Completed GPS Alternative Script
Well, I spent more and more time on google... didn't help. Finally got it, if you want it, here it is! The alternative solution to GPS...
A video stream!
Code:
const nameScript = "NS/VDub Overlay Script"
Dim fso, StumbleSubFile
Dim StartTime, DifferenceTime
Dim LastRecord
Set fso = CreateObject("Scripting.FileSystemObject")
Sub OnEnableScan()
Set StumbleSubFile = fso.CreateTextFile("C:\Stumbles\StumbleSub.ssa", True)
StumbleSubFile.WriteLine("[Script Info]")
StumbleSubFile.WriteLine("Title: NetStumbler 'WebCam GPS Replacement'")
StumbleSubFile.WriteLine("Original Script: Assassin Bunnie <assassin@bunnie.net>")
StumbleSubFile.WriteLine("ScriptType: v4.00")
StumbleSubFile.WriteLine("Collisions: Normal")
StumbleSubFile.WriteLine("PlayResY: 240")
StumbleSubFile.WriteLine("PlayDepth: 0")
StumbleSubFile.WriteLine("Timer: 100.0000")
StumbleSubFile.WriteLine("")
StumbleSubFile.WriteLine("[V4 Styles]")
StumbleSubFile.WriteLine("Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, TertiaryColour, BackColour, Bold, Italic, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, AlphaLevel, Encoding")
StumbleSubFile.WriteLine("Style: MainB,Arial,14,65535,65280,65535,0,0,-1,1,2,4,1,16,16,16,0,0")
StumbleSubFile.WriteLine("Style: MainT,Arial,14,65535,65280,65535,0,0,0,1,2,4,5,16,16,16,0,0")
StumbleSubFile.WriteLine("Style: Timer,Arial,14,65535,65280,65535,0,0,-1,1,2,4,5,16,16,40,0,0")
StumbleSubFile.WriteLine("Style: B0S0K,Arial,14,&HE0E0E0,65280,65535,&H000000,0,-1,1,0,0,5,16,16,40,0,0")
StumbleSubFile.WriteLine("Style: B2S2R,Arial,14,&HE0E0E0,65280,65535,&H004080,0,-1,1,2,2,5,16,16,40,0,0")
StumbleSubFile.WriteLine("Style: B2S6G,Arial,14,&HE0E0E0,65280,65535,&H408000,0,-1,1,2,6,5,16,16,40,0,0")
StumbleSubFile.WriteLine("Style: B4S4B,Arial,14,&HE0E0E0,65280,65535,&H804000,0,-1,1,4,4,5,16,16,40,0,0")
StumbleSubFile.WriteLine("Style: Karaoke,Arial,14,&H40FFFF,&HFF4040,65535,0,0,0,1,2,4,5,16,16,16,0,0")
StumbleSubFile.WriteLine("Style: ShiftJIS,MS Gothic,20,&HE0E0E0,65280,65535,0,0,0,1,2,4,5,16,16,16,0,128")
StumbleSubFile.WriteLine("")
StumbleSubFile.WriteLine("[Events]")
StumbleSubFile.WriteLine("Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text")
StumbleSubFile.WriteLine("")
StartTime = Timer
LastRecord = StartTime
End Sub
'######################################################################
Sub OnScanResult(SSID, BSSID, CapFlags, Signal, Noise, LastSeen)
'######################################################################
' SSID : String : SSID (Network name)
' BSSID : String : BSSID (MAC address)
' CapFlags : Integer : 802.11 capability flags
' Signal : Integer : signal level (dBm)
' Noise : Integer : noise level(dBm)
' LastSeen : Time
DifferenceTime = Timer - StartTime
TimeString = Int(DifferenceTime / 3600) & ":"
DifferenceTime = DifferenceTime - Int(DifferenceTime / 3600)
TimeString = Timestring & Int(DifferenceTime / 60) & ":"
DifferenceTime = DifferenceTime - Int(DifferenceTime / 60)
TimeString = Timestring & Int(DifferenceTime) & "."
DifferenceTime = DifferenceTime - Int(DifferenceTime)
If LastRecord <> DifferenceTime Then
StumbleSubFile.WriteLine("Dialogue: Marked=0," & TimeString & "00," & TimeString & "99,MainB,,0000,0000,0000,!Effect,{\a5\c&HE0E0E0&}" & SSID & " " & BSSID & " " & Signal)
LastRecord = DifferenceTime
End If
End Sub
Sub OnDisableScan()
StumbleSubFile.Close
End Sub
Now, before I'd been trying to overlay the caption onto the vid in real time, but all OCXes I could find wanted money to not be faulty in some way - perfectly reasonable ^_^ It occured to me tonight that the way to do it is _after_ the drive.
Therefore... using VirtualDub (use our friend Google to find it ^_^), a perfectly free video editing program, as well as the VirtualDub Subtitler 2.4 filter, you can record the video stream from whatever device you have (in my case, a webcam strapped to the dash), then add on the data created by the script later.
It might be a second off, because you have to start recording the vid and start the scan at essentially the same time... but yea, it's pretty cool ^_^ To see an example, if you have the divx codec, check out h**p://assassin.bunnie.net/nsvid/VDubStumbleSubbed.avi . If you'd like to know more, let me know.
Please accept that I'm very tired and this might not be wholly perfect yet, consider it a "Version 1". If it's shit, let me know! If it's not a pile of bloody fecies... let me know! :-P
__________________
An assassin needs no blade, only their stealth.
Last edited by Thorn : 10-03-2005 at 06:16 AM.
Reason: Encase script in Code tags
|