few tweaks to get this working with avconv