FFmpeg installing the build process under Linux

Source: Internet
Author: User

Reprint please the head source link and the tail two-dimensional code reproduced together, this article from: http://blog.csdn.net/hejjunlin/article/details/52402759

Today, the introduction of FFmpeg under Linux installation of the compilation process, with the CentOS, the overall process is relatively smooth, that is, in the ffmpeg and other time a little longer. There are no technical difficulties. Only if the record.

About FFmpeg

FFmpeg is an open source, free cross-platform video and audio streaming solution that belongs to free software, with a LGPL or GPL license (depending on the component you choose). It provides a complete solution for recording, converting, and streaming audio and video. It contains a very advanced audio/video codec library Libavcodec, in order to ensure high portability and codec quality, Libavcodec Many codec are developed from scratch.

FFmpeg configuration

Before installing FFmpeg, first install the YASM
1. Installing Yasm
Baidu Encyclopedia explains this: Yasm is a completely rewritten NASM assembly. Currently, it supports x86 and AMD64 instruction sets, accepts NASM and gas compilation syntax, outputs binary, ELF32, ELF64, COFF, Mach-o (32 and up), RDOFF2, Win32 and Win64 object formats, and generates stabs debug letters DWARF 2, CodeView 8 format. The reason why this is used in FFmpeg is mainly to support compiling ffmpeg-x264.

1. Download the yasm-1.3.0.tar.gz version:

wget http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz

2. Once the download is complete, unzip it with the start

tar xzvf yasm-1.3.0.tar.gz

3. Enter the directory and start compiling

cd yasm-1.3.0./configuremake

4. Installation

install

Upon completion

5. Start download ffmpeg, download 3.1.3 Release ffmpeg here

Upon completion

6. Once the download is complete, unzip it with the start

tar -zxvf ffmpeg-3.1.3.tar.gz

7. Enter the directory and start compiling

cd ffmpeg-3.1.3./configuremake

This article originates from: http://blog.csdn.net/hejjunlin/article/details/52402759

8. Installation

install

The above process is compiled and installed, the black bold file is compiled.
The executable program with debug information is represented as a _g.

Instance usage

After the completion of the compilation, naturally hope that we have a role, otherwise it will not be nothing to compile ffmpeg.

1. Convert the first 120 frames of the video into a GIF, the size specified as 230*450:

-i device-2016-08-25-193402.-vframes120  -s230-y-f gif Super3.gif

2. Call the FFmpeg command to turn a video into 3gp format:

-i device-2016-08-25-193402.-y-b20-s-r10-acodec-ab23.85-ac1-ar16000 video.3gp

Other FFmpeg use

Syntax: ffmpeg [[options]['-i ' input_file] ... {[options] output_file} ...

  • Capture a 352x240 size, JPG-formatted picture
    Ffmpeg-i test.asf-y-F image2-t 0.001-s 352x240 s.jpg

  • Intercepts thumbnails for a specified time
    Ffmpeg-i test.avi-y-F image2-ss 8-t 0.001-s 350x240 test.jpg
    The time unit followed by-ss is seconds

  • Convert file to 3GP format
    Ffmpeg-y-I test.mpeg-bitexact-vcodec h263-b 128-r 15-s 176x144
    -acodec aac-ac 2-ar 22500-ab 24-f 3gp test.3gp
    or ffmpeg-y-i test.wmv-ac 1-acodec libamr_nb-ar 8000-ab 12200-s 176x144-b 128-r

  • Video format Conversion
    How to get high-quality video using FFMPEG encoding
    Ffmpeg.exe-i "C:device-2016-08-25-193402.mp4"-target film-dvd-s 720x352
    -padtop 64-padbottom 64-maxrate 7350000-b 3700000-sc_threshold 1000000000
    -trellis-cgop-g 12-bf 2-qblur 0.3-qcomp 0.7-me full-dc 10-mbd 2
    -aspect 16:9-pass 2-passlogfile "D:videoffmpegencode"-an-f mpeg2video "D:FEARLESS.M2V"

  • Convert the specified format file to the FLV format
    Ffmpeg.exe-i meng.mp3-ab 56-ar 22050-b 500-r 15-s
    Ffmpeg.exe-i meng.wmv-ab 56-ar 22050-b 500-r 15-s

  • Convert file to MP4 format
    Ffmpeg-y-I input.wmv-f mp4-async 1-s 480x320-acodec libfaac-vcodec libxvid-qscale 7-dts_delta_threshold 1 output.m P4
    Ffmpeg-y-I Source_video.avi input-acodec libfaac-ab 128000-vcodec mpeg4-b 1200000-mbd 2-flags +4mv+trell-aic 2-c MP 2-subcmp 2-s 320x180-title X final_video.mp4

  • Using the FFmpeg video screen
    Ffmpeg-vcodec mpeg4-b 1000-r 10-g 300-vd x11:0,0-s 1024x768 ~/device-2016-09-02-193402.avi
    : Wherein,-VD x11:0,0 refers to the recording using an offset of x=0 and y=0,-s 1024x768 refers to the size of the recorded video as 1024x768. The recorded video file is Test.avi and will be saved to the user's home directory
    If you want to record only one application window or a fixed area on the desktop, you can specify the offset position and the area size. Use the Xwininfo-frame command to complete the lookup of the above parameters.

  • Resize Video size
    Ffmpeg-vcodec mpeg4-b 1000-r 10-g 300-i ~/device-2016-08-25-193402.avi-s 800x600 ~/device-2016-08-25-193402-800-600. Avi
    Note: FFmpeg's screen recording function is only available in Linux environments.

  • Video capture
    Record the camera's live video and save it as a file
    Ffmpeg-f video4linux-s 320*240-r 10-i/dev/video0 test.asf

The first time to get blog update reminders, as well as more Android dry, source code Analysis , Welcome to follow my public number, sweep the bottom QR code or long press to identify two-dimensional code, you can pay attention to.

If you feel good, easy to praise, but also to the author's affirmation, can also share this public number to you more people, original not easy

FFmpeg installing the build process under Linux

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.