avconv: refactor selecting an encoder