CentOS-6.4 compile and install ffmpeg plus x264 and rtmp

Source: Internet
Author: User

CentOS 6.4-64-bit under compile ffmpeg a few simple steps:

1. Pre-compilation environment preparation;

2. Download the source code;

3. compile, install;

-----------------------------------------------

Below is a description of one of the following:

First, install the necessary environment required:

Command line:

# yum Install autoconf automake gcc gcc-c++ git libtool make nasm pkgconfig zlib-devel

Make sure the machines are networked

# yum Install yasm (You can also do this without installing the compilation)

Second, install the x264 support Library:

Download libx264 source code, unzip the local (verbose ... )

CD into the x264 directory

Command line: #./configure--enable-shared--disable-asm

# make

#make Install

(You can also rely on x264 's static library, after compiling the head file and. A copy to/usr/local/include and Lib)

Third, install the RTMP support library:

Download rtmp source code, unzip the local

CD into the rtmp directory

You can disable the RTMP internal OpenSSL module before compiling:

Edit the Makefile file in the rtmp directory and librtmp directory Note: #CRYPTO =openssl

Then compile rtmp

Command line : # make

# make install

Four, compile and install FFmpeg:

Download FFmpeg source, unzip the local

CD into the FFmpeg directory configuration Configure

Note: In the execution of configure when prompted "Librtmp not found" error, you can comment out the ffmpeg directory configure file:

Note "#enabled librtmp && require_pkg_config librtmp librtmp/rtmp.h rtmp_socket-lws2_32-lwinmm", the line, and other configuration After you manually add the make file.

Compile below:

Command line : #./configure--enable-static--disable-shared--disable-yasm--enable-memalign-hack--ENABLE-GPL-- enable-libx264--enable-librtmp--extra-cflags=-i/usr/local/include--extra-ldflags=-l/usr/local/lib--prefix=/usr /local

Note: If you annotated the above rtmp, you need to manually modify the Config.mak file under the FFmpeg directory:

Find the "extralibs=" item and add the-lrtmp at the end of it

Continue compiling:

Command line : #make

After compiling successfully ffmpeg even if the compilation is complete, you can perform the following./ffmpeg

If you are prompted that the libx264 library cannot be found, you can manually copy the corresponding library from the x264 directory to the/usr/lib/directory and execute the command line: Ldconfig

Installation:

Command line : #make install

CentOS-6.4 compile and install ffmpeg plus x264 and rtmp

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.