#!/bin/sh for i in *.$1; do ffmpeg -i "$i" "$3/${i%.*}.$2"; done