ffmpeg script to convert files - Programming On Unix

Users browsing this thread: 1 Guest(s)
s0kx
Members
Hi Ramiferous! I haven't actually played with ffmpeg before, but I'll assume that the command you provided is correct. This would be my solution to your problem:

Code:
#!/bin/bash
for i in *.{mkv,webm}; do
    ffmpeg -i "$i" -codec copy "${i%.*}.mp4"
    rm "$i"
done

You could also take out the rm command and run
Code:
rm *.{mkv,webm}
manually afterwards so you can first make sure that files were actually converted how you wanted. Hopefully this works for you :)


Messages In This Thread
ffmpeg script to convert files - by pfr - 15-03-2021, 12:22 AM
RE: ffmpeg script to convert files - by movq - 15-03-2021, 02:59 AM
RE: ffmpeg script to convert files - by s0kx - 15-03-2021, 03:00 AM
RE: ffmpeg script to convert files - by movq - 15-03-2021, 03:15 AM
RE: ffmpeg script to convert files - by pfr - 15-03-2021, 07:57 PM
RE: ffmpeg script to convert files - by ckester - 16-03-2021, 01:41 AM
RE: ffmpeg script to convert files - by pfr - 16-03-2021, 07:25 PM