FFmpeg无法找到AV_CODEC_ID_WMAV2

时间:2015-11-16 10:06:41

标签: ffmpeg wma

我要解码wma类型文件使用FFmpeg, 用选项

编译它

--enable-decoder=wmav1 --enable-decoder=wmav2, --enable-encoder=wmav1, --enable-encoder=wmav2 --enable-demuxer=xwma

和我使用的源代码如下:

        av_register_all();
        //avcodec_register_all();

        if ((ret = avformat_open_input(&fmt_ctx, src_filename, 0, 0)) < 0) {
            LOG("Could not open source file %s, ret:%d", src_filename, ret);
            return;
        }

        if ((ret = avformat_find_stream_info(fmt_ctx, 0)) < 0) {
            LOG("Could not find stream information---ret:%d", ret);
            return;
        }

avformat_find_stream_inforet:-541478725

而失败

并添加ffmpeg -i <inputfile>命令行日志:

D:\Downloads\ffmpeg-static\bin>ffmpeg.exe -i ring.wma
ffmpeg version N-76684-g1fe82ab Copyright (c) 2000-2015 the FFmpeg developers
  built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-l
ibilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --ena
ble-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc
 --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enabl
e-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --
enable-lzma --enable-decklink --enable-zlib
  libavutil      55.  6.100 / 55.  6.100
  libavcodec     57. 15.100 / 57. 15.100
  libavformat    57. 14.100 / 57. 14.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 15.100 /  6. 15.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Guessed Channel Layout for  Input Stream #0.0 : stereo
Input #0, asf, from 'ring.wma':
  Metadata:
    WMFSDKNeeded    : 0.0.0.0000
    DeviceConformanceTemplate: L3
    WMFSDKVersion   : 11.0.6001.7001
    IsVBR           : 0
    PeakValue       : 18081
    AverageLevel    : 1915
  Duration: 00:00:07.80, start: 0.000000, bitrate: 206 kb/s
    Stream #0:0: Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, 2 channels, fltp,
 192 kb/s

任何提示?

当我要解码特殊类型文件时,必须包含哪个选项?

谢谢。

1 个答案:

答案 0 :(得分:1)

你需要--enable-demuxer = asf。 xwma是一种边缘格式,并没有真正使用,wma音频通常打包在asf容器中。这些文件仍将具有“.wma”扩展名。