Ffmpeg移植S3C2440

简介: Ffmpeg移植过程:      FFmpeg是一个开源免费跨平台的视频和音频流方案,属于自由软件,采用LGPL或GPL许可证。它的移植同样遵循LGPL或GPL移植方法:configure、make、make insatll。

Ffmpeg移植过程:

     FFmpeg是一个开源免费跨平台的视频和音频流方案,属于自由软件,采用LGPL或GPL许可证。它的移植同样遵循LGPL或GPL移植方法:configure、make、make insatll。

 

1.下载ffmpeg开源库(ffmpeg-0.5.tar.bz2)放到相应文件夹。

#tar jxvf ffmpeg-0.5.tar.bz2

#cd ffmpeg-0.5

 

2.配置编译选项

#./configure --cross-prefix=/usr/local/arm/3.4.1/bin/arm-Linux- --enable-cross-compile --target-os=linux --cc=arm-linux-gcc --arch=arm --prefix=/usr/local/ffmpeg --enable-shared --disable-static --enable-gpl --enable-nonfree --enable-ffmpeg --enable-ffplay --enable-ffserver --enable-swscale --disable-vhook --enable-pthreads --disable-network --disable-ipv6 --enable-libamr-nb --enable-libamr-wb --enable-libfaac --enable-libfaad --enable-libmp3lame --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-yasm --disable-stripping --disable-optimizations --extra-cflags=-I/usr/local/ffextra/include --extra-ldflags=-L/usr/local/ffextra/lib

交叉编译器:arm-linux-gcc3.4.1

--cflags:ffmpeg第三方库头文件声明

--extra-ldflags:第三方库库文件路径

 

3.

#make

 

4.

#make install

把编译生成的库拷贝到2440开发板,配置环境变量。

 

编译过程错误:

1:libavcodec/arm/dsputil_arm_s.S
     libavcodec/arm/dsputil_arm_s.S: Assembler messages:
     libavcodec/arm/dsputil_arm_s.S:25: Error: unknown pseudo-op: `.eabi_attribute'
     libavcodec/arm/dsputil_arm_s.S:641: Error: bad instruction `push {r4-r10}'
     libavcodec/arm/dsputil_arm_s.S:724: Error: bad instruction `pop {r4-r10}'
     make: *** [libavcodec/arm/dsputil_arm_s.o] 错误 1

解决:在make的时候有一些asm指令找不到 
ffmpeg-0.5/libavcodec/arm/asm.S
24行: .eabi_attribute 24, /val改为@.eabi_attribute 24, /val 
28行: .eabi_attribute 25, /val改为@.eabi_attribute 25, /val

ffmpeg-0.5/libavcodec/arm/dsputil_arm_s.S
641行: push      {r4-r10} 改为 stmfd      sp!, {r4-r10} @ push      {r4-r10} 
724行: pop       {r4-r10} 改为  ldmfd      sp!, {r4-r10} @ pop       {r4-r10}

2:/home/liao/ffmpeg-0.5/libavcodec/libavcodec.so: undefined reference to `dlerror'
     /home/liao/ffmpeg-0.5/libavcodec/libavcodec.so: undefined reference to `dlclose'
     /home/liao/ffmpeg-0.5/libavcodec/libavcodec.so: undefined reference to `dlopen'
     /home/liao/ffmpeg-0.5/libavcodec/libavcodec.so: undefined reference to `dlsym'

解决:缺少libdl库文件,在Makefile文件中添加库文件
68行:ffserver_g$(EXESUF): FF_LDFLAGS += $(FFSERVERLDFLAGS)后面添加FF_LDFLAGS +=-ldl

至此,ffmpeg可以顺利编译!!

 

注意:

ffmpeg中ffplay需要SDL支持,如需编译ffplay,则需下面步骤:

     编译SDL,将其include、lib文件拷贝至第三方库路径(/usr/local/ffextra)

     在configure之前修改configure文件2042行:

     SDL_CONFIG="${cross_prefix}sdl-config"改为SDL_CINFIG="/usr/local/sdl/bin/sdl-config"

ffmpeg针对mp3、wma音频格式解码为浮点型,难以在arm上流畅运行。

目录
相关文章
|
Ubuntu 编译器 芯片
FFmpeg开发笔记(十):ffmpeg在ubuntu上的交叉编译移植到海思HI35xx平台
FFmpeg开发笔记(十):ffmpeg在ubuntu上的交叉编译移植到海思HI35xx平台
FFmpeg开发笔记(十):ffmpeg在ubuntu上的交叉编译移植到海思HI35xx平台
|
Android开发 C++
嵌入式实践教程--Android音频开发日志(一)—移植FFmpeg
嵌入式实践教程--Android音频开发日志(一)—移植FFmpeg
嵌入式实践教程--Android音频开发日志(一)—移植FFmpeg
|
Ubuntu 计算机视觉
OpenCV开发笔记(七十四):OpenCV3.4.1+ffmpeg3.4.8交叉编译移植到海思平台Hi35xx平台
OpenCV开发笔记(七十四):OpenCV3.4.1+ffmpeg3.4.8交叉编译移植到海思平台Hi35xx平台
OpenCV开发笔记(七十四):OpenCV3.4.1+ffmpeg3.4.8交叉编译移植到海思平台Hi35xx平台
FFmpeg开发笔记(十一):ffmpeg移植到海思HI35xx平台之将ffmpeg库引入到sample的demo中
FFmpeg开发笔记(十一):ffmpeg移植到海思HI35xx平台之将ffmpeg库引入到sample的demo中
FFmpeg开发笔记(十一):ffmpeg移植到海思HI35xx平台之将ffmpeg库引入到sample的demo中
|
Linux Windows C语言
|
Linux C语言
linux之x86裁剪移植---ffmpeg的H264解码显示(420、422)
<p>在虚拟机上yuv420可以正常显示 ,而945(D525)模块上却无法显示 ,后来验证了directdraw的yuv420也无法显示 ,由此怀疑显卡不支持 ,后把420转换为422显示。</p> <p>420显示如下:</p> <p></p> <pre code_snippet_id="1682097" snippet_file_name="blog_20160513_1_4130927
3666 0
嵌入式linux------ffmpeg移植 编码H264(am335x编码H264)
<div class="dp-highlighter bg_cpp" style="font-family: Consolas, 'Courier New', Courier, mono, serif; background-color: rgb(231, 229, 220); width: 938.515625px; overflow: hidden; padding-top: 1px; b
2845 0
嵌入式linux------ffmpeg移植 解码H264(am335x解码H264到yuv420并通过SDL显示)
<pre name="code" class="cpp">/* 编译命令:arm-linux-gcc -o show2642 264showyuv2.c -I/usr/local/ffmpeg_arm/include/ -L/usr/local/ffmpeg_arm/lib/ -lswresample -lavformat -lavutil -lavcodec -lswscale -lx2
3017 0
|
编解码 vr&ar 网络协议
ffmpeg在am335x上的移植
<p style="padding-top: 0px; padding-bottom: 0px; margin-top: 10px; margin-bottom: 10px; font-family: Arial; font-size: 16px; line-height: 24px; background-color: rgb(237, 237, 237);"><span style="pa
3014 0
|
C语言
FFMPEG 库移植到 VC 需要的步骤
在VC下使用FFMPEG编译好的库,不仅仅是把.h,.lib,.dll拷贝到工程中就行了,还需要做以下几步。(此方法适用于自己使用MinGW编译的库,也同样适用于从网上下载的编译好的库,例如http://ffmpeg.zeranoe.com/builds/)。
912 0