My script should work as follows: Check whether or not there are DAV files in the folder, if there are NO elements for a 1 minute loop until the next check, and if there are any DAV files, it should trigger DAV to JPEG conversion and move JPEGs to the SNAPSHOT folder, and DAV for PROCESSED folder. Until it works, the problem is finishing the conversion to JPEG and moving the files to folders, it closes the script, and it goes back to the loop and waits for a new file, this is not happening.
Another problem is also that the files are generated every 30 minutes in bulk, but they already appear in bulk and therefore end when the 30 minutes are over, or the problem is when the script ends or the script just moves to one. PROCESSED folder, and does not convert.
Script:
REM - - Checks for New Files (*.DAV).
:LOOP01
IF EXIST "C:\Users\AudicomRede\Documents\SNAPSHOT FINAL\TESTE VERIFICAÇÃO\*.*" GOTO SKIP01
:LOOP02
IF NOT EXIST "C:\Users\AudicomRede\Documents\SNAPSHOT FINAL\TESTE VERIFICAÇÃO" GOTO SKIP02
REM - ALL THIS WILL BE DONE IF THE DAV FILE EXISTS
:
:
:SKIP01
REM Crafty 1 minute delay...
PING 1.1.1.1 -n 10 -w 6000 >NUL
GOTO LOOP01
:
:
:SKIP02
REM START CONVERT
for %%A IN (*.dav) do (
ffmpeg -i "%%A" -r 0.2 -bt 20M -s 480x300 "%%~nA"%%03d.jpg
Move "%%A" PROCESSED
Move "*.*" SNAPSHOT
)
GOTO SKIP01
I use FFMPEG to convert all files.