ffmpeg - Encoding - Batch encode all files in a directory

for f in *.mp4; do ffmpeg -i "$f" "${f%.*}.mp4"; done
 
for f in *.mp4; do ffmpeg -i "$f" <additional options> "encoded/${f%.*}.mp4"; done

for %f in (*.mkv) do ffmpeg -i %f <additional options> %~nf.mp4

NOTE:

  • ~n: Removes the extension from the filename in batch mode.