Running convert from bat file
Posted: 2016-01-07T03:41:38-07:00
Hi,
I would like to create some mp4 videos from webcam images I take every 15mins.
That's how I would like to do it (works fine when I run the commands manually in cmd).
convert *.JPG -delay 10 -morph 10 %05d.morphed.jpg
ffmpeg -r 25 -i %05d.morphed.jpg video.mp4
The idea was to run these two commands on all sub-folders, where my webcam images are stored:
Thjat's my bat file:
The problem is, that %05d is not recognized properly as a command of "convert" and ffmpeg, so I tried doing the following:
Windows now creates lots of morph-0....morph-#####.jpg files. That's fine!
Unfortunately, the "convert" command does not work from the bat file. it says:
Could find no file with path 'C:\Users\martin\Pictures\_Webcam\test\2014-10-29\video\*.jpg' and index in the range 0-4
C:\Users\martin\Pictures\_Webcam\test\2014-10-29\video\*.jpg: No such file or directory
Any ideas how to mask(?)the %0 properly?
I would like to create some mp4 videos from webcam images I take every 15mins.
That's how I would like to do it (works fine when I run the commands manually in cmd).
convert *.JPG -delay 10 -morph 10 %05d.morphed.jpg
ffmpeg -r 25 -i %05d.morphed.jpg video.mp4
The idea was to run these two commands on all sub-folders, where my webcam images are stored:
Thjat's my bat file:
Code: Select all
set rootdir="C:\Users\martin\Pictures\_Webcam\test"
for /d %%i in (%rootdir%\*) do (
convert *.JPG -delay 10 -morph 10 %05d.morphed.jpg
ffmpeg -r 25 -i %05d.morphed.jpg video.mp4
)
pause
Code: Select all
set rootdir="C:\Users\martin\Pictures\_Webcam\test"
set counter=0
for /d %%i in (%rootdir%\*) do (
::echo %%i
mkdir %%i\video
convert %%i\*.JPG -delay 10 -morph 10 %%i\video\morph.jpg
ffmpeg -r 25 -i %%i\video\*.jpg %%i\video\webcam.mp4
)
pause
Unfortunately, the "convert" command does not work from the bat file. it says:
Could find no file with path 'C:\Users\martin\Pictures\_Webcam\test\2014-10-29\video\*.jpg' and index in the range 0-4
C:\Users\martin\Pictures\_Webcam\test\2014-10-29\video\*.jpg: No such file or directory
Any ideas how to mask(?)the %0 properly?