Batch ffmpeg conversion: windows to linux

I have a windows .bat file that converts all the .mp4 files of a certain folder (increases speed in a 1.5X ratio), places all the transformed files in an "out" subfolder, and finally deletes all original files. As follows:

for %%a in ("*.*") do ffmpeg -i "%%a" -filter_complex "[0:v]setpts=PTS/1.5[v];[0:a]atempo=1.5[a]" -map "[v]" -map "[a]" "out\%%~na.mp4"
for %%f in (*.mp4) do (del "%%~f")

Could someone please "translate" it to Linux (Ubuntu)? Thanks,

1

1 Answer

Adapted from How do you convert an entire directory with ffmpeg?

mkdir out
for i in *.mp4; do ffmpeg -i "$i" -filter_complex "[0:v]setpts=PTS/1.5[v];[0:a]atempo=1.5[a]" -map "[v]" -map "[a]" "out/${i%.*}.mp4"; done

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like