How to convert multiple video files (one directory) by FFMpeg on command line

for %a in ("*.3gp") do ffmpeg -i "%a" -c:v libx264 -c:a copy -q:v 0 -y "newfiles\%~na.mp4"
  • *.3gp – input files; what you want to convert
  • ffmpeg – ffmpeg executable; if you haven’t it in PATH, you have to insert absolut path to the ffmpeg (eg. c:\XXX\YYY\ffmpeg.exe)
  • -c:v libx264 – video codec – H.264 in this example
  • -c:a copy – audio code – „copy original audio stream“ in this example
  • -q:v 0 –  „same video quality“
  • newfiles\%~na.mp4 – output files; original file extension will be removed; directory must exists (newfiles in this example)

For more details and options, please use Google 🙂

Napsat komentář