I'm trying to batch convert a folder of MP4 files to AVI using this script:

for f in *.mp4; do ffmpeg -i "$f" -q:v 6 "encoded/${f%.*}.avi”; done

(This is based an earlier question that was helpfully answered for me by @Mulvya here: What's the best way to convert mp4 to avi?) I'm receiving the error message:

Unable to find a suitable output format for 'encoded/test file.avi”; done for f in *.mp4; do ffmpeg -i test' encoded/test file.avi”; done for f in *.mp4; do ffmpeg -i test: Invalid argument

Can anyone suggest where i may have made a mistake?

1 Answer 1


Change the to a ".

Avoid using TextEdit or other "smart" editors to edit your scripts and shell commands. They will mangle it with fancy quotes and other oddball characters and ruin your commands.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.