Wattskemov
Wattskemov

Reputation: 766

FFMpeg Can't find libvorbis under Windows

I try to use FFMpeg to generate MKV video format. By default, FFMpeg will using h264 & libvorbis. But when I using the doc/examples/muxing.c under ffmpeg source file folder, there is always an error:

[libvorbis @ 002e52a0] Specified sample format s16 is invalid or not supported
Could not open audio codec: Error number -22 occurred

I used Zeranoe FFmpeg and showed this error. I also tried to compile the ffmpeg from source under MinGW, and I also enable the libvorbis by following comfiguration:

$ ./configure --prefix=/mingw --enable-libvpx --enable-libvorbis --enable-shared --enable-static

Before I make, I also install libvorbis, libogg, yasm etc. But the error is still there.

If I use the ffmpeg.exe to convert video to webm format, it works. The command is like following:

ffmpeg -i test.h264 -vcodec libvpx -acodec libvorbis output.webm

The generated output.webm can be played by Firefox or something else. So I think the compiled ffmpeg library is OK. But why I can't generate webm file in muxing.c code?

Upvotes: 0

Views: 867

Answers (2)

Alfred Higgings
Alfred Higgings

Reputation: 1

Try compiling the libvorbis package with the following :

LDFLAGS="-static" \
LIBS="-logg" \
./configure \
--prefix=$INSTALL_PREFIX \
--with-gnu-ld \
--with-pic \
--enable-static \
--disable-shared \
--disable-oggtest

Upvotes: 0

pogorskiy
pogorskiy

Reputation: 4815

As can be seen in the file libvorbisenc.c, the libvorbis library supports only AV_SAMPLE_FMT_FLTP (float planar data) input format.

You have to use, for example, a SwResample library from ffmpeg for converting audio data.

Upvotes: 1

Related Questions