I have a Windows batch script that I want to run on Linux, but I'm having trouble converting it to a shell script
I wonder if anyone can help.
:start
for /r %%F in (*.mkv) do (
C:\Python27\Scripts\ffmpeg\bin\ffmpeg.exe -y -i "%%F" -c:v libx264 -preset ultrafast -minrate 4.5M -maxrate 4.5M -bufsize 9M -c:a ac3 "%%~dpnF.mp4"
if not errorlevel 1 if exist "%%~dpnF.mp4" del /q "%%F"
)
TIMEOUT /T 60
goto start
I've been trying to convert it to a shell script, but I'm having trouble. I'm not great at this.
for f in {*.mkv,*/*.mkv,*/*/*.mkv,*/*/*/*.mkv}; do
ffmpeg -i "$f" -c:v libx264 -preset ultrafast -minrate 4.5M -maxrate 4.5M -bufsize 9M -c:a ac3 "${f%mkv}mp4";
rm "$f";
I'm not sure how to loop it, so its constantly checking.