0

I'm trying to change the framerate of my video to 15fps and I need to do that for 100+ videos that are in the same folder

For processing a single video I use the following command- ffmpeg -i input.mp4 -filter:v fps=fps=15 processed/input_15fpst.mp4

How do I do this for multiple videos in the folder and add a suffix _15fps to them ? I'm not very familiar with Linux programming

Thank you so much!

I tried doing this-
for f in *.MP4; do ffmpeg -i "$f" -filter:v fps=fps=15 process/"$f"; done

But I want to rename the file as well, how do I change my loop?

  • It's not clear what you mean by "specify the format of the output". Do you not want the format to be MP4? Does it depend on the input file? What exactly is wrong with the `for` loop you already came up with? – tripleee Feb 03 '23 at 21:05
  • I'm not sure but I wrote it again and it worked for f in *.MP4; do ffmpeg -i "$f" -filter:v fps=fps=15 process/"$f"; done I'm figuring out how I can rename the file now. If my earlier file is called "input", how can I call the output "input_15fps". I've edited my question above – average_grad_student Feb 03 '23 at 21:10
  • `... -vf fps=15 "process/${f%.*}_15fps.${f##*.}"` – Баяр Гончикжапов Feb 04 '23 at 05:46

1 Answers1

0

This should do the trick:

for f in *.MP4; do ffmpeg -i "$f" -filter:v fps=fps=15 process/"${f}_15fps"; done
tink
  • 14,342
  • 4
  • 46
  • 50