I use the following FFMPEG script for DAV to AVI file conversion:
for %% A IN (* .dav) DO ffmpeg -i "%% A" -vcodec libx264 "%% A.avi
But DAV files are generated in the folder every 30 minutes, the script is triggered when the 1st DAV file is generated, but the conversion is fast, and it finishes before the next DAV file is generated in the folder, I need the script. convert the DAV and wait for the next file to arrive in the folder, or after converting the last DAV file that arrives in the folder 12:00 PM the script terminates the process.