Extensions: Support both libav and ffmpeg (bug 1773)

Dear libav and ffmpeg developers, thanks for having two
different codebases, and thanks for making it even harder
to use a single command (either "ffmpeg" or "avconv") from
third party applications. If it weren't for you, we would
not have spend some quality time fixing this bug...