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

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

Robert Thorne

Robert Thorne

Automotive & Future Transportation Editor

Robert Thorne covers electric vehicle innovations, autonomous driving systems, global mobility trends, and automotive engineering developments.

Share this article
Twitter Facebook Pinterest