操作系统:centos 6.5

必需要参考的文章:

http://blog.chinaunix.net/uid-23069658-id-4018842.html

准备工作:

安装git

yum install git -y

安装svn

yum install svn

Centos 准备安装删除已安装包

yum erase ffmpeg x264 x264-devel

Centos 安装各种依赖包

yum install  gcc gcc-c++ make nasm pkgconfig wget curl curl-devel zlib-devel openssl-devel perl cpio expat-devel gettext-devel libtool mhash.x86_64 perl-Digest-SHA1.x86_64  pcre.i386 pcre.x86_64 pcre-devel.i386 pcre-devel.x86_64 -y

 安装nasm编译器支持汇编优化(lame库需要)

防止因为时间不对,修改一下为北京时间

1.如果提示command not found,那说明ntp没有安装,使用如下命令进行安装 
yum -y install ntpdate ntp  2、ntpdate us.pool.ntp.org  3、设置硬件时间和软件时间的一致并校准 
/sbin/hwclock --systoh
wget http://www.nasm.us/pub/nasm/releasebuilds/2.11.05/nasm-2.11.05.tar.bz2
tar xvf nasm-2.11.05.tar.bz2
cd nasm-2.11.05 配置安装目录为/usr/bin:
./configure --prefix=/usr 编译并安装:
make && make install
安装yasm编译器支持汇编优化(ffmpeg库需要)

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

解压:

tar xvf yasm-1.2.0.tar.gz

cd yasm-1.2.0

配置安装目录为/usr/bin:

./configure --prefix=/usr

编译并安装:

make && make install
安装x264库支持h.264视频转码
安装x264库支持h.264视频转码

执行以下命令获取x264的最新源代码

git clone git://git.videolan.org/x264.git

cd x264

./configure --enable-shared

make && make install

安装 LibNut

 安装libnut,该软件需要用svn获取源代码,svn可以直接用yum install svn来装。先下载:
# svn co svn://svn.mplayerhq.hu/nut/src/trunk libnut
下载后代码保存在新建立的libnut目录下,对于64位Linux需要修改配置文件:
# cd libnut
# vi config.mak
在最后一个CFLAGS下一行增加:
CFLAGS += -fPIC
然后编译安装:
# make
# make install
====================================================================================================================================================
安装libogg

yum install libogg-devel
安装libtheora (svn获取)
# svn co http://svn.xiph.org/trunk/theora theora
# cd theora
# ./autogen.sh
# ./configure
# make
# make install
安装libvorbis
# wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.0.tar.gz
# tar xvfz libvorbis-1.2.0.tar.gz
# cd libvorbis-1.2.0
# ./configure
# make
# make install

安装libvpx

++++++++libvpx+++++++++++
git clone http://git.chromium.org/webm/libvpx.git (本次获取后打包为libvpx-v1.2.0.tar.gz) 其它获取方式#wget http://webm.googlecode.com/files/libvpx-v1.1.0.tar.bz2
cd libvpx
./configure --enable-shared
make && make install
++++++++Xvid+++++++++++
#wget http://downloads.xvid.org/downloads/xvidcore-1.3.2.tar.gz
tar zxf xvidcore-1.3.2.tar.gz
cd xvidcore/build/generic
./configure
make && make install
上面的媒体支持库安装完后,可以设置下环境准备编译ffmpeg了。不过在此之前必须修改环境变量

vim /etc/ld.so.conf

在文件末增加一行:

/usr/local/lib

       然后生效之:

ldconfig -v
编译ffmpeg

执行以下命令获取ffmpeg源代码

git clone git://source.ffmpeg.org/ffmpeg.git

cd ffmpeg

./configure  --enable-version3  --enable-libvpx --enable-libfaac --enable-libmp3lame  --enable-libvorbis --enable-libx264 --enable-libxvid --enable-shared --enable-gpl --enable-postproc --enable-nonfree --enable-avfilter --enable-pthreads --enable-libnut --enable-libtheora

***需要保证 --enable-libx264能执行

make && make install

ldconfig -v

TS流分割器segmenter的安装与使用

git clone https://github.com/johnf/m3u8-segmenter
cd m3u8-segmenter
gcc -Wall -g m3u8-segmenter.c -o segmenter -lavformat -lavcodec -lavutil
cp segmenter /usr/bin/ 
直接转成ts

ffmpeg -i vp5.flv -acodec copy -vcodec libx264 vp5.ts 

150MB的一个MPG文件,大约转换时间:4分零7秒。

切割 
segmenter -i vp5.ts -d 10 -p segmenter_test -m vp5.m3u8 -u http://127.0.0.1:8080/Video/ 这样就可以切片出m3u8文件 直接使用hls

在Centos 6.5 X64下切割m3u8的更多相关文章

  1. CentOS 6.5 x64下安装宝塔面板、阿里安骑士

    一.安装宝塔: CentOS下命令(https://www.bt.cn/bbs/thread-1186-1-1.html) yum install -y wget && wget -O ...

  2. CentOS 6.5 x64下Hadoop安装

    Apache Hadoop安装部署模式 单机(本地)模式(Standalone Mode) 伪分布模式(Pseudo-Distributed Mode) 完全分布模式(Fully Distribute ...

  3. CentOS 6.5 x64下查看服务版本

    1.查看服务是否是64位 [root@Yimmei ~]# getconf LONG_BIT 642.查看服务器版本信息 [root@Yimmei ~]# lsb_release -a LSB Ver ...

  4. CentOS 6.5 x64下查找依赖包,或用YUM安装

    查看某个命令YUM上的安装源 1)当某个命令不存时进行查询所依赖的包,如:pstree [root@localhost ~]# yum provides pstree 已加载插件:fastestmir ...

  5. CentOS 6.5 x64下网络配置

    一.自动获取IP地址 #dhclient 自动获取ip地址命令 #ifconfig 查询系统里网卡信息,ip地址.MAC地址 [root@CentOS6 ~]# vi /etc/sysconfig/n ...

  6. CentOS 6.5 x64下安装VMware tools

    [root@CentOS6 /]# mount /dev/cdrom /mnt mount: block device /dev/sr0 is write-protected, mounting re ...

  7. 在centos 6.9 x64下安装code::blocks步骤

    1.yum groupinstall "Development tools" 2.yum install gtk2* 3.安装wxWidgets 下载地址:https://www. ...

  8. Centos 6.5 x64环境下 spark 1.6 maven 编译-- 已验证

    Centos 6.5 x64 jdk 1.7 scala 2.10 maven 3.3.3 cd spark-1.6 export MAVEN_OPTS="-Xmx2g -XX:MaxPer ...

  9. Centos 6.5 X64 环境下编译 hadoop 2.6.0 --已验证

    Centos 6.5 x64 hadoop 2.6.0 jdk 1.7 protobuf-2.5.0 maven-3.0.5 set environment export JAVA_HOME=/hom ...

随机推荐

  1. ELK+zookeeper+kafka+rsyslog集群搭建

    前言 环境困境: 1.开发人员无法登陆服务器 2.各系统都有日志,日志数据分散难以查找 3.日志数据量大,查询忙,不能实时 环境要求: 1.日志需要标准化   集群流程图:   角色:   软件: 以 ...

  2. Python-第三方模块requests快速入手

    首先确认一下 Requests 已经安装 Requests 是最新的版本 如果没有安装requests,请按照下面的方式安装 安装requests window和Linux环境下都可以输入 $ pip ...

  3. QTimer的一些注意事项和探索

    注意事项: 1.QTimer's accuracy depends on the underlying operating system and hardware.Most platforms sup ...

  4. ORA-00257: archiver error. Connect internal only, until freed【日志归档清理】

    select * from V$FLASH_RECOVERY_AREA_USAGE;  查看使用情况 用plsql登陆时提示“ORA-00257: archiver error. Connect in ...

  5. 输出单个文件中的前 N 个最常出现的英语单词,并将结果输入到文本文件中。程序设计思路。

    将文件内容读取后存入StringBuffer中. 利用函数将段落分割成字符串,按(“,”,“.”,“!”,“空格”,“回车”)分割,然后存入数组中. 遍历数组,并统计每个单词及其出现的次数. 要求出文 ...

  6. c++官方文档-copy constructor

    #include <iostream> using namespace std; class Example5 { string* ptr; public: Example5(const ...

  7. 47.纯 CSS 创作一个蝴蝶标本展示框

    html,body{ margin:; padding:; } body{ height: 100vh; display: flex; justify-content: center; align-i ...

  8. python学习笔记_week14

    Web框架本质 众所周知,对于所有的Web应用,本质上其实就是一个socket服务端,用户的浏览器其实就是一个socket客户端. s1 import socket def handle_reques ...

  9. 解决oracle导入未分配表空间的问题

    select 'alter table ' || t.TABLE_NAME || ' allocate extent;' from user_tables t order by t.TABLE_NAM ...

  10. Shell 编程(循环)

    for in 循环语句 #!/bin/bash for x in one two three four do echo number $x done 例:取出passwd中每一行name 并输出 he ...