Successfully ported ffmpeg on mini2440

Publisher:采菊东篱下Latest update time:2020-05-14 Source: eefocusKeywords:mini2440 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

On mini2440, the entire porting process is divided into three steps: (1) compile x264; (2) compile ffmpeg; (3) after the porting is successful, test it by using ffmpeg to record the video.


(1) Compile x264

I downloaded the latest x264 from the official website, the address is http://www.videolan.org/developers/x264.html . The file I downloaded is last_x264.tar.bz2.


The decompression command is #tar -jxv -f last_x264.tar.bz2, and the decompressed directory is x264-snapshot-20130313-2245.


Enter the unzipped directory and execute the command ./configure --disable-asm, then config.mak will be generated. Then you need to modify the config.mak file and rewrite ARCH=ARM SYS=LINUX CC=arm-linux-gcc, where CC is written to your own cross-compilation environment location, and the corresponding AR and RANLIB are also written, as shown in the figure below.

I remember that the -m32 option seemed to be deleted in lines 10 and 11. If there are no errors in the subsequent make execution, you don't need to worry about this.


Then execute make

Then execute make install, so x264 has been compiled successfully. There will be a x264.h header file in the /usr/local/include/ directory and a libx264.a library file in the /usr/local/lib/ directory.

(2) Compile ffmpeg

Download FFmpeg 0.8.14 from the official website: http://ffmpeg.org/download.html , unzip it and execute the following command:

./configure --cross-prefix=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 --disable-ffplay --enable-ffserver --enable-swscale --enable-pthreads --disable-armv5te --disable-armv6 --disable-armv6t2 --disable-yasm --disable-stripping
ffplay is not used here, you can add it if you need it, refer to http://blog.csdn.net/liaozc/article/details/6025610 which says that you need to use the SDL library, you can try it. Modify --cc --prefix according to your own directory, then make and make install, and then find the lib include folder you want to use under --prefix.


Notice:

[1] After executing the long configure command above, there will be a warning message saying that an arm-linux-ptkconfig cannot be found, and some message like fail. I didn't take a screenshot, but it looks like this warning message. You can ignore it. I changed several files and repeated the above steps, but this warning message still appeared. I wasted a lot of time here.


【2】The process of executing make takes a long time, which requires patience.


【3】After executing make install, a ffmpeg folder will be generated under /usr/local/, as shown in the figure below.

(3) After successful transplantation, test it by using ffmpeg to record the video

Note: Because my mini2440 development board does not have enough free space, I use nfs to start the development board. If there is enough space, it is the same to put the library file directly into the board.


Copy the two library files with suffixes .so and .so.* in the /usr/local/ffmpeg/lib file in the above figure to the development board (if a library is missing, an error will be reported when executing ./ffmpeg later, saying that it cannot be found)

The red box in the above picture only shows some of the library files. They all appear in pairs, but with different suffixes.


Because there is no ffmpeg command in the development board, you need to copy the ffmpeg executable file in the /usr/local/ffmpeg/bin/ directory to the development board, and then increase its executable permissions (chmod +x ffmpeg)

Then execute the command: #./ffmpeg -f video4linux2 -s 320x240 -i /dev/video0 /mnt/test.avi. The execution process is shown in the figure below:

During the recording process, input q to stop the recording. The generated test.avi file is in the /mnt/ directory. We can watch it with a common player.

Keywords:mini2440 Reference address:Successfully ported ffmpeg on mini2440

Previous article:Arm mini2440 video remote monitoring based on v4l2 ffmpeg x264
Next article:Let's learn mini2440 bare metal development (Part 3) -- S3C2440 clock learning

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号