VideoHelp Forum
+ Reply to Thread
Results 1 to 2 of 2
Thread
  1. As you may have noticed, it is possible to scan video streams for errors with the GUI version of VirtualDub ("virtualdub.exe"). This can be accomplished by clicking on "Video" and "Scan video stream for errors" (and making sure that "Error mode" is set to "Report all errors"). However, as far as the command-line version of the program (vdub.exe) is concerned, I was not able to find any command-line options for scanning video streams for errors with VirtualDub... In other words, I have not found out how to use a batch to invoke the VDub function that scans video streams for errors. Does any of you know how to do this?

    I skimmed through the HTML Help file for VirtualDub ("VirtualDub.chm") to no avail. I also checked the oft-referenced 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 without any success.

    The script I would like to put together should give me a batch with roughly 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
    Something resembling the code above should work provided that there are VDub script arguments for scanning video streams for errors.

    Just to let you know, the usage of vdub.exe is:

    vdub.exe /i Yourscript.script foo.avi

    ...and to quote the VirtualDub Help, the /i "invokes a script with arguments. All arguments following the script filename until the next switch are passed to the script in the VirtualDub.params[] array."

    Actually, I wrote a simple batch that could be used for this purpose (see the attachment), but only in the future – it does not contain the needed parts for VDub scripts ATM. With slight modifications it could be used for other programs that have the same error scanning feature as VDub. However, I am afraid the batch is poorly written, and I suspect that many people will find that it also has some annoying attributes. With some editing, it should do the job though (provided that the programs that are to be used support scanning video streams for errors via CLI)... Right now it just uses vdub.exe to open the video files that can be found in the current directory and its subfolders but it does not scan them for errors. Unfortunately, the batch requires that you have both tee.exe (input redirector/printer) and unix2dos.exe (UNIX EOL to DOS/Windows EOL converter) located in the PATH environment variable. So if you want to run the batch, you need the executables...

    Tee.exe is a part of UnxUtils for Windows: http://unxutils.sourceforge.net/
    Unix2dos has many different implementations, one of which can be found here: http://waterlan.home.xs4all.nl/dos2unix.html

    As I warned, the code of the batch is not particularly good IMHO. I'm not a coder/developer by any means!

    I used the following sources for some parts of the batch:
    Getting current directory and full path: http://stackoverflow.com/questions/280969/windows-batch-loop-over-folder-string-and-pa...st-folder-name
    Creating files with unique filenames: http://blogs.msdn.com/b/myocom/archive/2005/06/03/so-what-the-heck-just-happened-there.aspx
    Escaping sequences for special characters: http://www.robvanderwoude.com/escapechars.php
    List of different video file types: http://www.fileinfo.com/filetypes/video
    Image Attached Files
    Quote Quote  
  2. NB! Just to let you know, if you have solution that requires Bash for some reason, I can use Cygwin which can run Bash shell scripts.

    ...and to accomplish roughly the same thing with a shell script that Cygwin can run, I could create an .sh file with the following lines:

    Code:
    #!/bin/bash
    printf '\033\143'
    echo "FILES FOUND" | tee -a "VDubLogfileUNIX.txt"
    echo | tee -a "VDubLogfileUNIX.txt"
    find "$(pwd)" -type f | grep -E -i '.\.(avi|flv)$' | tee -a "VDubLogfileUNIX.txt" && echo | tee -a "VDubLogfileUNIX.txt" && echo "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" | tee -a "VDubLogfileUNIX.txt" && echo "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" | tee -a "VDubLogfileUNIX.txt" && echo | tee -a "VDubLogfileUNIX.txt"
    echo "RESULTS" | tee -a "VDubLogfileUNIX.txt"
    echo | tee -a "VDubLogfileUNIX.txt"
    (find -iname "*.avi"; echo)|while read f; do if [ -z "$f" ]; then continue; fi; "/cygdrive/c/path/to/vdub.exe" "$f" | dos2unix | tee -a "VDubLogfileUNIX.txt" && echo | tee -a "VDubLogfileUNIX.txt" && echo "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" | tee -a "VDubLogfileUNIX.txt" && echo | tee -a "VDubLogfileUNIX.txt"; done
    (find -iname "*.flv"; echo)|while read f; do if [ -z "$f" ]; then continue; fi; "/cygdrive/c/path/to/vdub.exe" "$f" | dos2unix | tee -a "VDubLogfileUNIX.txt" && echo | tee -a "VDubLogfileUNIX.txt" && echo "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" | tee -a "VDubLogfileUNIX.txt" && echo | tee -a "VDubLogfileUNIX.txt"; done
    echo "END OF FILE" | tee -a "VDubLogfileUNIX.txt"
    echo
    echo "Done!"
    echo
    echo
    echo
    echo
    echo
    echo
    echo "Creating a copy of the logfile with DOS paths and Windows EOL..."
    TMPDIR=$(mktemp)
    trap 'rm -rf "$TMPDIR"' EXIT
    find "$(pwd)" -type f | grep -E -i '.\.(avi|flv)$' >> "$TMPDIR"
    (cat "$TMPDIR"; echo) | while read line; do
        if [ -z "$line" ]; then continue; fi
        cygpath -wal "$line" |sed 's/^/"/'|sed 's/$/"/' >>"VDubLogfileWin.txt"; done
    echo >>"VDubLogfileWin.txt"
    echo "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" >>"VDubLogfileWin.txt"
    echo "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" >>"VDubLogfileWin.txt"
    echo >>"VDubLogfileWin.txt"
    echo "RESULTS" >>"VDubLogfileWin.txt"
    echo >>"VDubLogfileWin.txt"
    (find -iname "*.avi"; echo)|while read f; do if [ -z "$f" ]; then continue; fi; "/cygdrive/c/path/to/vdub.exe" "$f" >>"VDubLogfileWin.txt" && echo >>"VDubLogfileWin.txt" && echo "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" >>"VDubLogfileWin.txt" && echo >>"VDubLogfileWin.txt"; done
    (find -iname "*.flv"; echo)|while read f; do if [ -z "$f" ]; then continue; fi; "/cygdrive/c/path/to/vdub.exe" "$f" >>"VDubLogfileWin.txt" && echo >>"VDubLogfileWin.txt" && echo "::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::" >>"VDubLogfileWin.txt" && echo >>"VDubLogfileWin.txt"; done
    sed -i '1s/^/ \n/' "VDubLogfileWin.txt"
    sed -i '1s/^/FILES FOUND\n/' "VDubLogfileWin.txt"
    echo "END OF FILE" >>"VDubLogfileWin.txt"
    unix2dos "VDubLogfileWin.txt"
    echo
    echo "Done!"
    echo
    function pause(){
       read -p "$*"
    }
    pause 'Press [Enter] key to continue...'
    exit
    If using vdub.exe (CLI version of VirtualDub) for scanning video streams for errors is something that should be done by taking a look at the source code, then I am afraid I have hit a brick wall with this problem unless the function I'm looking for can be found reasonably quickly – I know nothing about Assembly language or C++ which were used for writing VirtualDub. I have no programming skills at the moment.

    Do you have any suggestions on how to remedy this problem?
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!