Infoseite // Tip: Automated stills with Windows Scripting Host and VLC Player!



Frage von Andreas_Kiel:


Hi,
if you have larger projects, we need an occasional one Stillimage. A complete list of still images is not bad, if one wants to document his project. Rather than pester now a trainee to take it to the VLC player and a little script ... done!

Requirements:
- The VLC player is installed;
- To have a hotkey for a snapshot is by default to Shift + S;
- The Windows Scripting Host is enabled on XP for me it is version 5.7;
- Code below is from a store with almost any name ending in ". Vbs extension.

How it works:
- The script takes a cpl. Directory as the object and passes to meet each file as a parameter to the VLC;
- The VLC starts with this file;
- Two seconds later, a snapshot is triggered by shift + S will simulate a keypress;
- Again two seconds later, the VLC is terminated (; is important, because otherwise he builds each time a new instance);
- Next file, etc., etc.

[code: 1:795 b41fa68] files dim
'Takes the number of files in the directory to
dim counter
'is one with, perhaps for the important test - see below
endung test = "m2t"
'This is the extension of files to be processed
'It should work with all the endings, where the VLC is processed
set was = CreateObject (; "WScript.Shell")
'A shell object to start to Programs
Set fso = CreateObject (; "Scripting.FileSystemObject")
'A file system object
set list = fso.GetFolder (; "\, \; Server02 \; capturing")
'Remove from this list the individual files, drive letters are better

'Next two lines create a log file
Set fs = CreateObject (; "Scripting.FileSystemObject")
set logbook fs.OpenTextFile = (, \, \; Server02 \; capturing \; stills \; standbilder.txt ", 8, true, 0)
'If it exists, is added

files = verzeichnis.files.count
'Count is possibly interesting, but everything counts

counter = 1
For Each file In verzeichnis.files
'Now open each found file
Set f1 = fso.GetFile (; file.path)
endung fso.GetExtensionName = (, f1)
'Isses eh?
then if endung = test endung
'So if there is the required type
ws.run (; "I: \; Programs \; VideoLAN \; VLC \; vlc.exe + file.path)
'Run this file with the VLC
WScript.Sleep 2000
'Wait 2 seconds, so that the picture is stable
'Sometimes you have wobbler at the beginning

ws.sendkeys (; "S")
'Send now the hotkey for a screenshot - default Shift S

WScript.Sleep 2000
'Wait 2 seconds again, so do not get the VLC while saving ALT F4
'Which would not otherwise

ws.sendkeys (;"%{ f4) ")
'Send ALT F4 and VLC to quit

logbuch.writeline now & "-" & file.path & "= Stillimage generated"
'Successful File in Minutes

else
logbuch.writeline now & "-" & & file.path "matches = net"
'File type does not match

end if
counter = counter + 1
'if counter> 20 then WScript.Quit
'Commenting in real operation. To play and play absolutely uncommented use
'Script can require hours and is almost non-stop
next
logbuch.close
msgbox "statues were created" [/ code: 1:795 b41fa68]

Important notes:
Space


Antwort von B.DeKid:

Cool thing is now still lay in Multimedia Builder is a GUI s.and Link the script and is ready dei Video Snapshot Progi ;-)

To security in the MMB file still nen query installation of VLC, and the archive, or VLC ne ne exe Direct Download application.


But as I said very good idea:-P

MfG
B. DeKid

Space





slashCAM nutzt Cookies zur Optimierung des Angebots, auch Cookies Dritter. Die Speicherung von Cookies kann in den Browsereinstellungen unterbunden werden. Mehr Informationen erhalten Sie in unserer Datenschutzerklärung. Mehr Infos Verstanden!
RSS Suche YouTube Facebook Twitter slashCAM-Slash