【问题标题】:Failed to compile HTTP-Live-Video-Stream-Segmenter-and-Distributor无法编译 HTTP-Live-Video-Stream-Segmenter-and-Distributor
【发布时间】:2012-03-21 11:29:00
【问题描述】:

我在 Ubuntu 11.10 上运行,打算编译 HTTP Live Video Stream Segment and Distrbutor

按照here 的指示,我设法相应地设置了FFMpeg。但是当我尝试配置它时遇到了这个错误。

gcc -v -Wall -g live_segmenter.c -o live_segmenter \ -lavformat -lavcodec -lavutil -lvorbis -ltheora\ -lbz2 -lm -lz -lfaac -lmp3lame \ -I/tmp/old_ffmpeg/包括\ -L/tmp/old_ffmpeg/lib

以下是错误信息:

    Using built-in specs.
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/lto-wrapper
    Target: x86_64-linux-gnu
    Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.6.1-9ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++,go --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
    Thread model: posix
    gcc version 4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3) 
    COLLECT_GCC_OPTIONS='-v' '-Wall' '-g' '-o' 'live_segmenter' '-I' '/tmp/old_ffmpeg/include' '-L/tmp/old_ffmpeg/lib' '-mtune=generic' '-march=x86-64'
     /usr/lib/gcc/x86_64-linux-gnu/4.6.1/cc1 -quiet -v -I /tmp/old_ffmpeg/include -imultilib . -imultiarch x86_64-linux-gnu live_segmenter.c -quiet -dumpbase live_segmenter.c -mtune=generic -march=x86-64 -auxbase live_segmenter -g -Wall -version -fstack-protector -o /tmp/ccJ5ih1S.s
    GNU C (Ubuntu/Linaro 4.6.1-9ubuntu3) version 4.6.1 (x86_64-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.1-p3, MPC version 0.9
    GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
    ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
    ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../x86_64-linux-gnu/include"
    #include "..." search starts here:
    #include <...> search starts here:
     /tmp/old_ffmpeg/include
     /usr/lib/gcc/x86_64-linux-gnu/4.6.1/include
     /usr/local/include
     /usr/lib/gcc/x86_64-linux-gnu/4.6.1/include-fixed
     /usr/include/x86_64-linux-gnu
     /usr/include
    End of search list.
    GNU C (Ubuntu/Linaro 4.6.1-9ubuntu3) version 4.6.1 (x86_64-linux-gnu)
        compiled by GNU C version 4.6.1, GMP version 5.0.1, MPFR version 3.0.1-p3, MPC version 0.9
    GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
    Compiler executable checksum: 5dede901e38d49932d3155c3e888bca1
    COLLECT_GCC_OPTIONS='-v' '-Wall' '-g' '-o' 'live_segmenter' '-I' '/tmp/old_ffmpeg/include' '-L/tmp/old_ffmpeg/lib' '-mtune=generic' '-march=x86-64'
     as --64 -o /tmp/ccFEK6Gy.o /tmp/ccJ5ih1S.s
    COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/
    LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.6.1/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../:/lib/:/usr/lib/
    COLLECT_GCC_OPTIONS='-v' '-Wall' '-g' '-o' 'live_segmenter' '-I' '/tmp/old_ffmpeg/include' '-L/tmp/old_ffmpeg/lib' '-mtune=generic' '-march=x86-64'
     /usr/lib/gcc/x86_64-linux-gnu/4.6.1/collect2 --build-id --no-add-needed --as-needed --eh-frame-hdr -m elf_x86_64 --hash-style=gnu -dynamic-linker /lib64/ld-linux-x86-64.so.2 -z relro -o live_segmenter /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../x86_64-linux-gnu/crt1.o /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../x86_64-linux-gnu/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.6.1/crtbegin.o -L/tmp/old_ffmpeg/lib -L/usr/lib/gcc/x86_64-linux-gnu/4.6.1 -L/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../.. /tmp/ccFEK6Gy.o -lavformat -lavcodec -lavutil -lvorbis -ltheora -lbz2 -lm -lz -lfaac -lmp3lame -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-linux-gnu/4.6.1/crtend.o /usr/lib/gcc/x86_64-linux-gnu/4.6.1/../../../x86_64-linux-gnu/crtn.o
    /tmp/old_ffmpeg/lib/libavcodec.a(vaapi.o): In function `commit_slices':
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:97: undefined reference to `vaCreateBuffer'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:106: undefined reference to `vaCreateBuffer'
    /tmp/old_ffmpeg/lib/libavcodec.a(vaapi.o): In function `alloc_buffer':
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:125: undefined reference to `vaCreateBuffer'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:127: undefined reference to `vaMapBuffer'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:125: undefined reference to `vaCreateBuffer'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:127: undefined reference to `vaMapBuffer'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:125: undefined reference to `vaCreateBuffer'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:127: undefined reference to `vaMapBuffer'
    /tmp/old_ffmpeg/lib/libavcodec.a(vaapi.o): In function `destroy_buffers':
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:37: undefined reference to `vaDestroyBuffer'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:37: undefined reference to `vaDestroyBuffer'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:37: undefined reference to `vaDestroyBuffer'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:37: undefined reference to `vaDestroyBuffer'
    /tmp/old_ffmpeg/lib/libavcodec.a(vaapi.o): In function `render_picture':
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:48: undefined reference to `vaUnmapBuffer'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:61: undefined reference to `vaBeginPicture'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:65: undefined reference to `vaRenderPicture'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:69: undefined reference to `vaRenderPicture'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:74: undefined reference to `vaEndPicture'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:52: undefined reference to `vaUnmapBuffer'
    /home/tony/Desktop/ffmpeg-export-2009-12-01/libavcodec/vaapi.c:57: undefined reference to `vaUnmapBuffer'
    collect2: ld returned 1 exit status

似乎缺少一些库,但我不知道它是什么。

如何解决这个问题 - 已更新

只要加上 -lva 就可以了

gcc -v -Wall -g live_segmenter.c -o live_segmenter \ -lavformat -lavcodec -lavutil -lvorbis -ltheora\ -lbz2 -lm -lz -lfaac -lmp3lame -lva\ -I/tmp/old_ffmpeg/包括\ -L/tmp/old_ffmpeg/lib

【问题讨论】:

    标签: ubuntu http-live-streaming


    【解决方案1】:

    您缺少 libva,而且您也不需要它。您可以将 --disable-vaapi 添加到 ffmpeg 配置中。否则,您需要将 -lva 添加到您的 LDFLAGS。

    【讨论】:

    • 谢谢!显然将 -lva 添加到命令中是有效的,不知道你是如何追踪它的。附言。我为我的机器安装了 libva-dev。
    • @TonyMocha 您只需找到包含缺失符号的库。您可以使用 nm 查看 .so 文件,但 google 通常更快。有趣的是,您链接的许多库实际上并不会被分段器使用,只是因为编译 ffmpeg 的选项而存在。 libva 只是其中之一。
    猜你喜欢
    • 2012-09-20
    • 2012-01-02
    • 2015-01-12
    • 2012-06-27
    • 2021-05-21
    • 1970-01-01
    • 2023-03-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多