ffmpeg 编译常见错误
来源:互联网 发布:台球厅计费软件 编辑:程序博客网 时间:2024/06/05 19:38
转自 http://blog.chinaunix.net/uid-26000296-id-4217121.html
一、FFmpeg源代码下载与编译
# wget http://www.ffmpeg.org/releases/ffmpeg-0.5.13.tar.bz2
# tar -jxvf ffmpeg-0.5.13.tar.bz2
# vim ffmpeg_configure.sh
./configure \
--prefix=/YOUR_INSTLL_DIRECTORY \
--enable-gpl --enable-nonfree --enable-version3 \
--enable-swscale --enable-avfilter \
--enable-pthreads
【保存并退出】
# chmod +x ffmpeg_configure.sh
# ./ffmpeg_configure.sh
# make
# make install
二、生成SDK
将安装目录“”下的
YOUR_INSTLL_DIRECTORY/include
YOUR_INSTLL_DIRECTORY/lib
打包,就可以生成一个开发用的SDK
# tar -czvf YOUR_INSTLL_DIRECTORY/ ffmpeg_sdk.tar.gz
三、使用output_example测试SDK
1. 复制文件
将ffmpeg-0.5.13下的output_example.c复制到SDK目录;
2. 编译生成:
# gcc output_example.c -o output_example
-I/opt/.../include
-L/opt/.../lib
-lavcodec -lavdevice -lavfilter -lavformat -lavutil -lswscale
1) 错误提示:
/opt/.../ffmpeg-0.5.13/libswscale/swscale.c:1234: undefined reference to `pow'
/opt/.../ffmpeg-0.5.13/libswscale/swscale.c:1238: undefined reference to `sin'
/opt/.../ffmpeg-0.5.13.install/lib/libswscale.a(swscale.o): In function `sws_getGaussianVec':
...
解决:
编译时加链接linux的数学函数库 "-lm"
# gcc output_example.c -o output_example
-I/opt/.../include
-L/opt/.../lib
-lavcodec -lavdevice -lavfilter -lavformat -lavutil -lswscale
-lm
2) 错误提示:
/opt/.../lib/libavcodec.a(pthread.o): In function `avcodec_thread_free':
/opt/.../libavcodec/pthread.c:95: undefined reference to `pthread_join'
解决:
编译时加链接linux的多线程库 "-lpthread"
# gcc output_example.c -o output_example
-I/opt/.../include
-L/opt/.../lib
-lavcodec -lavdevice -lavfilter -lavformat -lavutil -lswscale
-lm -lpthread
3). 错误提示:
/opt/.../lib/libavcodec.a(pngdec.o): In function `decode_frame':
/opt/.../lib/libavcodec/pngdec.c:406: undefined reference to `inflateInit_'
/opt/.../lib/libavcodec.a(pngdec.o): In function `png_decode_idat':
/opt/.../lib/libavcodec/pngdec.c:365: undefined reference to `inflate'
/opt/.../lib/libavcodec.a(pngdec.o): In function `decode_frame':
/opt/.../lib/libavcodec/pngdec.c:591: undefined reference to `inflateEnd'
解决:
编译时加链接linux的通用例程库 "-lz"
# gcc output_example.c -o output_example
-I/opt/.../include
-L/opt/.../lib
-lavcodec -lavdevice -lavfilter -lavformat -lavutil -lswscale
-lm -lpthread -lz
4). 错误提示
/opt/.../lib/libavformat.a(allformats.o): In function `av_register_all':
/opt/.../libavformat/allformats.c:48: undefined reference to `avcodec_register_all'
/opt/.../lib/libavformat.a(utils.o): In function `av_find_stream_info':
...
原因: 包依赖关系
解决:
# gcc output_example.c -o output_example
-I/opt/ffmpeg/sourcecode/ffmpeg-0.5.13.install/include
-L/opt/ffmpeg/sourcecode/ffmpeg-0.5.13.install/lib
-lavformat -lavdevice -lavcodec -lavutil -lavfilter
-pthread -ldl -lswscale -lbz2 -lasound -lz -lm
四、运行
# ./output_example xxx.flv
# wget http://www.ffmpeg.org/releases/ffmpeg-0.5.13.tar.bz2
# tar -jxvf ffmpeg-0.5.13.tar.bz2
# vim ffmpeg_configure.sh
./configure \
--prefix=/YOUR_INSTLL_DIRECTORY \
--enable-gpl --enable-nonfree --enable-version3 \
--enable-swscale --enable-avfilter \
--enable-pthreads
【保存并退出】
# chmod +x ffmpeg_configure.sh
# ./ffmpeg_configure.sh
# make
# make install
二、生成SDK
将安装目录“”下的
YOUR_INSTLL_DIRECTORY/include
YOUR_INSTLL_DIRECTORY/lib
打包,就可以生成一个开发用的SDK
# tar -czvf YOUR_INSTLL_DIRECTORY/ ffmpeg_sdk.tar.gz
三、使用output_example测试SDK
1. 复制文件
将ffmpeg-0.5.13下的output_example.c复制到SDK目录;
2. 编译生成:
# gcc output_example.c -o output_example
-I/opt/.../include
-L/opt/.../lib
-lavcodec -lavdevice -lavfilter -lavformat -lavutil -lswscale
1) 错误提示:
/opt/.../ffmpeg-0.5.13/libswscale/swscale.c:1234: undefined reference to `pow'
/opt/.../ffmpeg-0.5.13/libswscale/swscale.c:1238: undefined reference to `sin'
/opt/.../ffmpeg-0.5.13.install/lib/libswscale.a(swscale.o): In function `sws_getGaussianVec':
...
解决:
编译时加链接linux的数学函数库 "-lm"
# gcc output_example.c -o output_example
-I/opt/.../include
-L/opt/.../lib
-lavcodec -lavdevice -lavfilter -lavformat -lavutil -lswscale
-lm
2) 错误提示:
/opt/.../lib/libavcodec.a(pthread.o): In function `avcodec_thread_free':
/opt/.../libavcodec/pthread.c:95: undefined reference to `pthread_join'
解决:
编译时加链接linux的多线程库 "-lpthread"
# gcc output_example.c -o output_example
-I/opt/.../include
-L/opt/.../lib
-lavcodec -lavdevice -lavfilter -lavformat -lavutil -lswscale
-lm -lpthread
3). 错误提示:
/opt/.../lib/libavcodec.a(pngdec.o): In function `decode_frame':
/opt/.../lib/libavcodec/pngdec.c:406: undefined reference to `inflateInit_'
/opt/.../lib/libavcodec.a(pngdec.o): In function `png_decode_idat':
/opt/.../lib/libavcodec/pngdec.c:365: undefined reference to `inflate'
/opt/.../lib/libavcodec.a(pngdec.o): In function `decode_frame':
/opt/.../lib/libavcodec/pngdec.c:591: undefined reference to `inflateEnd'
解决:
编译时加链接linux的通用例程库 "-lz"
# gcc output_example.c -o output_example
-I/opt/.../include
-L/opt/.../lib
-lavcodec -lavdevice -lavfilter -lavformat -lavutil -lswscale
-lm -lpthread -lz
4). 错误提示
/opt/.../lib/libavformat.a(allformats.o): In function `av_register_all':
/opt/.../libavformat/allformats.c:48: undefined reference to `avcodec_register_all'
/opt/.../lib/libavformat.a(utils.o): In function `av_find_stream_info':
...
原因: 包依赖关系
解决:
# gcc output_example.c -o output_example
-I/opt/ffmpeg/sourcecode/ffmpeg-0.5.13.install/include
-L/opt/ffmpeg/sourcecode/ffmpeg-0.5.13.install/lib
-lavformat -lavdevice -lavcodec -lavutil -lavfilter
-pthread -ldl -lswscale -lbz2 -lasound -lz -lm
四、运行
# ./output_example xxx.flv
0 0
- ffmpeg 编译常见错误
- ffmpeg编译错误
- ffmpeg编译错误
- 使用FFmpeg demo常见错误
- Mac OS X下编译并搭建ffmpeg开发环境及常见错误处理
- ---ffmpeg 编译错误解决方法-
- java常见编译错误
- 编译常见错误
- 常见编译错误---参数设置
- 编译链接常见错误
- VC编译常见错误
- 编译常见错误
- VC常见编译错误
- c编译常见错误
- c++ 常见编译错误
- 常见编译错误
- vc编译常见错误
- c++常见编译错误
- java的基本类型的长度
- iOS 百度地图改变popview 及改变定位图标
- 喜欢的网站
- android 去除title标题
- iOS-将经纬度转化成度分秒格式
- ffmpeg 编译常见错误
- 第三节课
- tuxedo 的下载地址 windows下用的
- [主席树] BZOJ 3932 [CQOI2015]任务查询系统
- Markdown语法规则
- phpmyadmin,访问主页报错: Error during session start; please check your PHP and/or webserver log file and c
- keil5(MDK5)配置S3C2440裸机开发调试环境
- Python Cookbook 20160513
- solr入门之搭建具有安全控制和权限管理功能的SolrCloud集群