I have several avi files in the one directory that I would like to convert to mp4s using avconv. Now I know the basic procedure of how to do this, manually, for each avi, namely (where $@ are the variables that change with each new avi):
avconv -i [email protected] -c copy [email protected]
but I was wondering if anyone knows of how to write a bash script to do this automatically. I have tried a modified version of the answer provided to my optimizing PNG question namely:
for k in `find . -name "*.avi"`
do
avconv -i "$k" -c copy "$k.mp4"
done
but as k is of the form ./filename avconv could not understand it when given as input. Another issue is that even though I used quotation marks, because many of my avis have spaces in their file names, for some reason avconv was being run for every space-separated word in the file's name.