Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

 
Scanning Video Streams For Errors With 'vdub.exe', Batch & VDub scripts for error scanning
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
Guljigit-01
Posted: Apr 21 2013, 09:37 AM


Unregistered









It's possible to scan video streams for errors with the GUI version of VirtualDub. However, I would like to accomplish the same with the CLI version, vdub.exe, by using batches or shell scripts along with VDub scripts. The problem is that I could not find any way of doing this despite going through the HTML Help file of VirtualDub ("VirtualDub.chm"), VirtualDub scripting language reference v0.7 at http://www.virtualdub.org/docs/vdscript.txt and a list of defined functions at http://virtualdubmod.sourceforge.net/Scripts.html. There was no mention of VDub script functions for scanning video streams for errors. Neither did I find anything about this while skimming through the VDub source code which was nothing but gibberish to me – I'm not a programmer.

The batch I would like to use would probably have the following simple syntax:

CODE
@echo off
"C:\Path\To\vdub.exe" /i SCRIPTNAME POSSIBLESCRIPTARGUMENTS "C:\Path\To\AVI01.avi" >>"VDubLogFile.txt"
"C:\Path\To\vdub.exe" /i SCRIPTNAME POSSIBLESCRIPTARGUMENTS "C:\Path\To\AVI02.avi" >>"VDubLogFile.txt"
"C:\Path\To\vdub.exe" /i SCRIPTNAME POSSIBLESCRIPTARGUMENTS "C:\Path\To\FLV01.avi" >>"VDubLogFile.txt"
"C:\Path\To\vdub.exe" /i SCRIPTNAME POSSIBLESCRIPTARGUMENTS "C:\Path\To\FLV02.avi" >>"VDubLogFile.txt"
## et cetera


Just to let you know, I have written a more detailed post about this on VideoHelp forums at http://forum.videohelp.com/threads/355414-...with-VirtualDub but since this is a forum dedicated to VirtualDub, this place might be my best bet for quick answers to this particular question.
 
  Top
dloneranger
Posted: Apr 21 2013, 10:23 AM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



The script command is VirtualDub.video.ScanForErrors();
I don't have any damaged videos though, so I can't say if vdub.exe will actually produce any useful output

Even if it does, I'm not sure that would be helpful either, as a lot of what I'd consider 'errors' (stuff that shows as garbage on display) doesn't get flagged as an 'error' - the errors can be hidden by the codecs etc and as far as virtualdub knows, that's how it's supposed to look
To test that, I overwrote a large part of a video with zero's in a hex editor, and virtualdub thought it was fine
A lot will depend on the input plugin/codecs etc

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
Guljigit-01
Posted: Apr 22 2013, 08:41 PM


Unregistered









According to the release notes at http://www.virtualdub.org/blog/pivot/entry.php?id=326 the script command is VirtualDub.video.ScanForErrors(); – exactly the same command you mentioned. However, for some reason, neither version 1.9.11 build 32842 nor version 1.10.3 build 35390 of VDub seems to recognize it as a valid command.

The batch and VDub Sylia script that I used had the following lines:

VDubScan.bat
CODE
@ECHO OFF
"C:\Users\John Doe\Desktop\VirtualDub\vdub.exe" /i "MyScript.syl" "C:\Users\John Doe\Desktop\Test.avi"


MyScript.syl
CODE
VirtualDub.Open(VirtualDub.params[0]);
VirtualDub.video.ScanForErrors(VirtualDub.params[0]);


When I ran the batch, I got the following error message: "Class 'VDVideo' does not have a member called 'ScanForErrors'"

The script command should be valid so I don't know where the shoe pinches. Any ideas where the problem might lie?
 
  Top
raffriff42
Posted: Apr 22 2013, 08:42 PM


Advanced Member


Group: Members
Posts: 384
Member No.: 35081
Joined: 25-June 12



I've done a few tests, using a hex editor to intentionally scramble a few bits in a test video. I find VirtualDubMod found the errors where VirtualDub didn't, probably because V-Mod is based on an old version of V-dub (1.5.10) (hey, error hiding is a feature, not a bug!)

Better yet, try using ffmpeg to encode the video (-preset superfast) and scan the output for the word 'error'. This seems to find the most errors.
 
     Top
dloneranger
Posted: Apr 22 2013, 08:58 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



There's not supposed to be a param in ScanForErrors
This works fine as a script
CODE
VirtualDub.Open(VirtualDub.params[0]);
VirtualDub.video.ScanForErrors();



--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
Guljigit-01
Posted: Jun 26 2013, 07:32 PM


Unregistered









The script worked fine, thx! I was able to take advantage of it in a simple batch that performs a recursive search for different video files. However, every time it scans a video stream for errors, it actually runs the GUI version of VirtualDub and the scan takes place in the GUI. There's nothing wrong with that considering that the errors that it detects are displayed on the CLI before the actual scan even starts... and my common sense tells me that since the errors are found before the actual scan even starts, the chance of spotting any errors during the scan is quite minuscule. However, is there any way of making vdub.exe display the scan results (and maybe even the progress bar) at the CLI prompt?

@raffriff42
I tested the ffmpeg method and it works like a charm. Actually, it might be one of the best CLI tools for finding errors in video streams (and the full ffmpeg CLI documentation is quite helpful). However, I intend to use it with several other tools (such as vdub.exe) just as a matter of precaution.
 
  Top
dloneranger
Posted: Jun 26 2013, 09:06 PM


Moderator


Group: Moderators
Posts: 2366
Member No.: 22158
Joined: 26-September 07



vdub.exe just runs virtualdub.exe and outputs any return messages to the cli, so no you can't skip the gui starting up

--------------------
MultiAdjust JoinWav WavNormalize FFMPeg Input Plugin v1827 UnSharpMask
Windows7/8 Codec Chooser
All FccHandlers Stuff inc. Installers for acm codecs AAC, AC3, LameMp3
 
    Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
6 replies since Apr 21 2013, 09:37 AM Track this topic | Email this topic | Print this topic

<< Back to General Discussion