gpt4 book ai didi

在C99中编译ffmpeg的例子得到错误的信息

转载 作者:太空宇宙 更新时间:2023-11-04 08:17:20 28 4
gpt4 key购买 nike

我可以使用 ffmpeg 构建环境运行“make examples”来获取 .o 文件。但我无法使用 C99 进行编译。我使用的操作系统是 Ubuntu 14.04,我按照 Installation of FFmpeg-2.8.5 in linux 配置了 ffmpeg。 ,安装无误。

这是详细信息(demuxing_decoding demuxing_decoding.c 在 ffmpeg_souce_folder/doc/examples 中):

 c99 -o demuxing_decoding demuxing_decoding.c -lavdevice -lavformat -lavcodec -lavfilter 
-lavutil -lswresample -lswscale -lz -lbz2
demuxing_decoding.c: In function ‘main’:
demuxing_decoding.c:326:9: warning: ‘avcodec_alloc_frame’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3927) [-Wdeprecated-declarations]
frame = avcodec_alloc_frame();
^
demuxing_decoding.c:406:9: warning: ‘avcodec_free_frame’ is deprecated (declared at /usr/include/libavcodec/avcodec.h:3952) [-Wdeprecated-declarations]
avcodec_free_frame(&frame);
^
/tmp/ccgEq0Zc.o: In function `decode_packet':
demuxing_decoding.c:(.text+0x561): undefined reference to `av_frame_unref'
/tmp/ccgEq0Zc.o: In function `open_codec_context':
demuxing_decoding.c:(.text+0x5f4): undefined reference to `av_get_media_type_string'
demuxing_decoding.c:(.text+0x66c): undefined reference to `av_get_media_type_string'
demuxing_decoding.c:(.text+0x6df): undefined reference to `av_get_media_type_string'
/tmp/ccgEq0Zc.o: In function `main':
demuxing_decoding.c:(.text+0xcc1): undefined reference to `av_frame_alloc'
demuxing_decoding.c:(.text+0x1082): undefined reference to `av_frame_free'
collect2: error: ld returned 1 exit status

我不知道哪里错了...我被困了两天...需要你的帮助。非常感谢!

最佳答案

我终于弄清楚了我的问题。在重建 ffmpeg 之前,我使用 apt-get 安装 ffmpeg。仅使用 sudo apt-get remove ffmpeg 删除它是不够的,另外运行此命令 sudo apt-get remove libavutil-dev libavutil-extra-51。之后,重建 ffmpeg。一切都很好~

关于在C99中编译ffmpeg的例子得到错误的信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35080272/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com