ffmpeg script to convert files - Programming On Unix

Users browsing this thread: 1 Guest(s)
pfr
Nixers
Hey nixers, I'm trying to figure out how to write a short script to convert all the media files in a directory and delete the old files.

I found this on the web looking for answers

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

So, my question is, how do I add other file types to the fist line so that if I have a folder which contains .mkv & .webm files then both file types will be converted to .mp4.

Lastly, as this will create newly converted files, how can I have all old files deleted within this same script?
_____________________________________________________________________________________________
“Maybe you have some bird ideas... Maybe that's the best you can do.” - Terry A. Davis (R.I.P Terry & Percival)


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