[Linux] in Linux, the MIPs platform cross-compiles the FFMPEG library and uses the library to capture a frame in the video.

Source: Internet
Author: User

I. Cross-compile FFMPEG library on the MIPs platform in Linux:

1. Download the source code of the FFMPEG Library
(Http://sourceforge.net/project/showfiles.php? Group_id = 205275 & package_id = 248632 ):
[Root @ localhost FFMPEG] # ls
Ffmpeg-laster.tar.gz
2. decompress:
[Root @ localhost FFMPEG] # tar zxvf ffmpeg-laster.tar.gz
3. Start configuration and compile:
[Root @ localhost FFMPEG] # mkdir FFMPEG-release
[Root @ localhost FFMPEG] # cd FFMPEG
[Root @ localhost FFMPEG] #. /configure -- enable-Cross-compile -- target-OS = Linux -- Cross-Prefix = mipsel-Linux--- cc = mipsel-Linux-GCC -- enable-shared -- arch = MIPS -- prefix =/opt/brcm/FFMPEG-release
[Root @ localhost FFMPEG] # Make
[Root @ localhost FFMPEG] # make install
[Root @ localhost FFMPEG] # CD ../FFMPEG-release
[Root @ localhost FFMPEG-release] # tar-zcvf ff1__lib.tar.gz./lib


Run on the Board:
# Cp ffjpeg_lib.tar.gz/usr/local/lib/
# Cd/usr/local/lib/
# Tar-zxvf ffjpeg_lib.tar.gz-C ../
# Rm ffjpeg_lib.tar.gz

# Cp FFMPEG-release/bin/*/bin/
# FFMPEG
FFmpeg version SVN-r21694, copyright (c) 2000-2010 Fabrice bellard, et al.
Built on Nov 17 2012 02:25:17 with GCC 4.5.3
Configuration: -- enable-Cross-compile -- target-OS = Linux -- Cross-Prefix = mipsel-Linux--- cc = mipsel-Linux-GCC -- enable-shared -- arch = MIPS -- prefix = /opt/brcm/FFMPEG-release
Libavutil 50. 9. 0/50. 9. 0
Libavcodec 52.52. 0/52.52. 0
Libavformat 52.51. 0/52.51. 0
Libavdevice 52. 2. 0/52. 2. 0
Libswscale 0.10. 0/0.10. 0
Hyper fast Audio and Video Encoder
Usage: FFMPEG [Options] [[infile options]-I infile]... {[OUTFILE options] OUTFILE }...

Use-h to get full help or, even better, run 'man FFMPEG'
#

So far, we have successfully transplanted FFMPEG to our development board.

 

Ii. Use the FFMPEG library in Linux:

1. Use the following command line:
FFmpeg-I test.mp4-y-F image2-SS 30-S 95*95-vframes 1 a.jpg
Find an MP4 File: test.mp4, and then use the above command to obtain the image of the video for 30 seconds, save
95*95 pixels JPG file.

FFmpeg-I ipv94.mp4-vframes 30-pix_fmt rgb24-y-F GIF a.gif
Convert the first 30 frames into GIF files.

2. Call the function in the program to capture video images:
First, add warehouse receiving support. In the MAKEFILE file of our executable program, add:
Cflags + =-I/opt/brcm/FFMPEG-release/include/
Lflags + =-L/opt/brcm/FFMPEG-release/lib/-lavutil-lavformat-lavcodec-lswscale
(Remember, the last four parameters are indispensable; otherwise, compilation fails)
Then a mature demo is attached to the FFMPEG library method in programming.
(Test_snap.c and makefile)

With several websites I have read:

Http://ray.imiddle.net/2008/10/ffmpeg-install-and-usage/

Http://blog.csdn.net/menuconfig/article/details/2600890

Http://bbs.chinaunix.net/thread-1932536-1-1.html

Related Article

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.