Don't raise exception if libvpx codec is not found.
The code will use the default codec from On2.
@@ -304,10 +304,12 @@ def ffmpeg_open_stream(file, index):
# VP8 and VP9 default codec don't support alpha transparency.
# Force libvpx codec in this case.
if codec_id == AV_CODEC_ID_VP9:
- codec = avcodec.avcodec_find_decoder_by_name("libvpx-vp9".encode('utf-8'))
+ newcodec = avcodec.avcodec_find_decoder_by_name("libvpx-vp9".encode('utf-8'))
+ codec = newcodec or codec
if codec_id == AV_CODEC_ID_VP8:
- codec = avcodec.avcodec_find_decoder_by_name("libvpx".encode('utf-8'))
+ newcodec = avcodec.avcodec_find_decoder_by_name("libvpx".encode('utf-8'))
+ codec = newcodec or codec
if not codec:
raise FFmpegException('No codec found for this media. '
