Transplant ffmpeg to davinci Platform

Source: Internet
Author: User
Transplant ffmpeg To The davinci platform-Linux general technology-Linux programming and kernel information. The following is a detailed description. Recently, I want to create a player on Davinci and select ffmpeg.

Compiling environment: FC7, target: Davinci dm6446, and target OS: linux

1) download ffmpeg. ffmpeg is released through the SVN version management system. You can use the command to obtain: svn checkout svn: // svn. mplayerhq. hu/ffmpeg/trunk ffmpegs

2) The cross-compilation tool uses the tool chain (arm_v5t_le-) of for armv5t in mvlinux. The gcc version is 3.4.3. You can also install a cross-compilation tool on your own;

3) because the ffmpeg player ffplay requires SDL support, you need to download and compile the SDL first. You can download the source code at http://www.libsdl.org/currently sdl-1.2.13.

Decompress the package and execute configure.

. /Configure -- prefix =/vlc/cross/SDL-1.2.13/install -- host = arm-linux -- disable-arts -- disable-nasm -- disable-video-x11 -- disable-nas -- disable-joystick -- disable- cdrom CC = arm_v5t_le-gcc AR = arm_v5t_le-ar RANLIB = arm_v5t_le-ranlib

Then make and then make install.

4) Compile ffmpeg. It is very simple to compile ffmpeg on FC. However, cross-compilation is troublesome because of the support of SDL. You need to modify the configure file, because SDL is cross-compiled, the installation path is not the default path of the system, and the SDL information cannot be found during ffmpeg configure. The configure is modified as follows (search SDL ):

Sdl_cflags = '-I/vlc/cross/SDL-1.2.13/install/include/SDL-D_GNU_SOURCE = 1-D_REENTRANT'
Temp_cflags $ sdl_cflags
Temp_extralibs '-L/vlc/cross/SDL-1.2.13/install/lib-Wl,-rpath,/vlc/cross/SDL-1.2.13/install/lib-lSDL-lpthread'
Enable sdl
Restore_flags
# End
# Luojc
Echo "SDL_CFLAFS =-I/vlc/cross/SDL-1.2.13/install/include/SDL-D_GNU_SOURCE = 1-D_REENTRANT"> config. mak
Echo "SDL_LIBS =-L/vlc/across/SDL-1.2.13/install/lib-Wl,-rpath, /vlc/cross/SDL-1.2.13/install/lib-lSDL-lpthread "> config. mak
# End

After changing the configure, execute

./Configure -- arch = armv5t -- cross-prefix = arm_v5t_le--- enable-cross-compile -- target-OS = linux -- disable-optimizations -- cc = gcc -- enable-shared

Then make it. You can see ffplay :)

5) Check the library required by ffplay.

[Root @ Nemooo ffmpegs] # arm_v5t_le-ldd ffplay
Libavdevice. so.52 =>/opt/montavista/pro/devkit/arm/v5t_le/target/lib/libavdevice. so.52 (0xdead1000)
Libavformat. so.52 =>/opt/montavista/pro/devkit/arm/v5t_le/target/lib/libavformat. so.52 (0xdead2000)
Libavcodec. so.51 =>/opt/montavista/pro/devkit/arm/v5t_le/target/lib/libavcodec. so.51 (0xdead3000)
Libavutil. so.49 =>/opt/montavista/pro/devkit/arm/v5t_le/target/lib/libavutil. so.49 (0xdead4000)
Libm. so.6 =>/opt/montavista/pro/devkit/arm/v5t_le/target/lib/tls/libm. so.6 (0xdead5000)
LibSDL-1.2.so.0 =>/opt/montavista/pro/devkit/arm/v5t_le/target/lib/libSDL-1.2.so.0 (0xdead6000)
Libpthread. so.0 =>/opt/montavista/pro/devkit/arm/v5t_le/target/lib/tls/libpthread. so.0 (0xdead7000)
Libc. so.6 =>/opt/montavista/pro/devkit/arm/v5t_le/target/lib/tls/libc. so.6 (0xdead8000)
Libz. so.1 =>/opt/montavista/pro/devkit/arm/v5t_le/target/usr/lib/libz. so.1 (0xdead9000)
Libbz2.so. 1.0 =>/opt/montavista/pro/devkit/arm/v5t_le/target/usr/lib/libbz2.so. 1.0 (0xdeada000)
Libdl. so.2 =>/opt/montavista/pro/devkit/arm/v5t_le/target/lib/tls/libdl. so.2 (0xdeadb000)
Libts-0.0.so.0 =>/opt/montavista/pro/devkit/arm/v5t_le/target/usr/lib/libts-0.0.so.0 (0xdeadc000)
/Lib/ld-linux.so.3 =>/opt/montavista/pro/devkit/arm/v5t_le/target/lib/ld-linux.so.3 (0xdeadd000)
[Root @ Nemooo ffmpegs] #

Copy the related library files to the/usr/lib/directory of the target machine, copy ffplay to the execution directory of the target machine, and run ffplay. OK. [Note: SDL will find the/dev/fb0 framebuffer device by default, while the framebuffer device in mvlinux is/dev/fb/0. If you do not change the SDL source code, you can create a symbolic link, ln/dev/fb/0/dev/fb0. You can play the h. 264 and mpeg4 video format files, but the decoding is performed by arm rather than dsp, so it looks slow, but the process has passed, the next step is to throw the decoding work to the dsp.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.