[Libav-user] avformat_alloc_output_context2 with WEBM defaults to VP9/Opus now - need to change

black copper blackcopper1 at gmail.com
Mon Oct 19 12:14:18 CEST 2015


Sorry for the delay:


> The output context only has suggested default codecs. You can just
> change them to whatever you want, you don't have to follow the default
> (ie. just don't  listen to AVCodec->video_codec/audio_codec, but set
> your own.
>

I have patched my code with something like:

avformat_alloc_output_context2(&this->ocVid, opfmt, NULL,
this->filenameVid.c_str());
if ( ocVid->oformat->audio_codec == AV_CODEC_ID_OPUS )
{
ocVid->oformat->audio_codec = AV_CODEC_ID_VORBIS;
}
if ( ocVid->oformat->video_codec == AV_CODEC_ID_VP9 )
{
ocVid->oformat->video_codec = AV_CODEC_ID_VP8;
}
this->fmtVid = this->ocVid->oformat;

This did the work for me; however, default VLC or Media Player Classic is
unable to play it properly - however, it does playback fine on firefox
browser, and also with FFPlay.

Both VLC and MPC should not show this problem, as they were working
properly before... I wonder what is wrong..
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20151019/d496312c/attachment.html>


More information about the Libav-user mailing list