Re: avformat_alloc_output_context2 with WEBM defaults to VP9/Opus now - need to change

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: avformat_alloc_output_context2 with WEBM defaults to VP9/Opus now - need to change

black copper
I posted a question yesterday; posting again as reminder - maybe someone has a quick solution:

Hi,

I am using FFmpeg Zeranoe builds for Windows. I took a snapshot of their builds few months ago, and just recently decided to upgrade it.

As with previous build, when I called avformat_alloc_output_context2() function with something like:

avformat_alloc_output_context2(&ocVid, NULL, NULL, "test.webm")

I always got the right codec: WebM with VP8 video and Vorbis audio.

Now, with the latest build, it is giving me VP9 video and Opus audio. Due to some reasons, Opus just don't seem to work with me, giving me error with function:

avcodec_open2()

with some text like: "Invalid argument" (when seen with av_strerror() function ).

I just want to use VP8/Vorbis; any ideas how I can force avformat_alloc_output_context2() to use this?

Thanks,

On Tue, Oct 6, 2015 at 5:42 PM, black copper <[hidden email]> wrote:
Hi,

I am using FFmpeg Zeranoe builds for Windows. I took a snapshot of their builds few months ago, and just recently decided to upgrade it.

As with previous build, when I called avformat_alloc_output_context2() function with something like:

avformat_alloc_output_context2(&ocVid, NULL, NULL, "test.webm")

I always got the right codec: WebM with VP8 video and Vorbis audio.

Now, with the latest build, it is giving me VP9 video and Opus audio. Due to some reasons, Opus just don't seem to work with me, giving me error with function:

avcodec_open2()

with some text like: "Invalid argument" (when seen with av_strerror() function ).

I just want to use VP8/Vorbis; any ideas how I can force avformat_alloc_output_context2() to use this?

Thanks,


_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: avformat_alloc_output_context2 with WEBM defaults to VP9/Opus now - need to change

Hendrik Leppkes
On Wed, Oct 7, 2015 at 9:12 AM, black copper <[hidden email]> wrote:
> I posted a question yesterday; posting again as reminder - maybe someone has
> a quick solution:
>

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.
Without seeing your code its impossible to know what you are doing, however.

- Hendrik
_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user
Reply | Threaded
Open this post in threaded view
|

Re: avformat_alloc_output_context2 with WEBM defaults to VP9/Opus now - need to change

black copper
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..

 

_______________________________________________
Libav-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/libav-user