1.rtmp服务器

nginx+pcre+zlib+openssl+nginx-rtmp-module

./configure \

--prefix=/usr/local/nginx \

--sbin-path=/usr/local/nginx/nginx \

--conf-path=/usr/local/nginx/nginx.conf \

--pid-path=/usr/local/nginx/nginx.pid \

--error-log-path=/usr/local/nginx/logs/error.log \

--with-pcre=/project/pcre-8.33 \

--with-zlib=/project/zlib-1.2.8 \

--with-http_dav_module \

--with-http_flv_module \

--with-http_stub_status_module \

--without-http_scgi_module \

--without-http_uwsgi_module \

--without-http_gzip_module \

--without-http_ssi_module \

--without-http_proxy_module \

--without-http_memcached_module \

--without-http_empty_gif_module \

--without-mail_pop3_module \

--without-mail_imap_module \

--without-mail_smtp_module \

--with-http_ssl_module \

--with-openssl=/project/openssl-1.0.1e \

--add-module=/project/nginx-rtmp-module-master

make && make install

修改nginx-rtmp-module-master/test/rtmp-publisher目录下player.html中rtmp推流接收地址和stream

增加nginx-rtmp-module-master/test/rtmp-publisher目录下播放器相关文件权限x

具体参考:http://www.cnblogs.com/aHuner/p/3247068.html

2.rtmp实时推流

推流工具:Adobe Flash Media Live Encoder

必须同时推音频和视频,否则ffmpeg切片会报错,e2eSoft VCam做模拟视频输入,手机耳机插入PC麦克风插口做音频输入

3.安装x264

wget ftp://ftp.videolan.org/pub/x264/ ... 2245-stable.tar.bz2

tar jxvf x264-snapshot-20120718-2245-stable.tar.bz2

./configure --prefix=/usr/local/x264 --disable-asm --enable-shared

make && make install

vi /etc/ld.so.conf

加入:/usr/local/x264/lib

执行:ldconfig

4.安装aac

http://www.audiocoding.com/faac.html

./configure --prefix=/usr/local/faac--enable-shared

make&&make install

遇到错误:

mpeg4ip.h:126: error: new declaration ‘char* strcasestr(const char*, const char*)’

解决方法:

vi common/mp4v2/mpeg4ip.h

修改第123行:

#ifdef __cplusplus

extern "C++" {

#endif

const char *strcasestr(const char *haystack, const char *needle);

#ifdef __cplusplus

}

#endif

vi /etc/ld.so.conf

加入:/usr/local/faac/lib

执行:ldconfig

5.ffmpeg切片方案

./configure --disable-yasm --enable-libx264--enable-libfaac --enable-gpl --enable-shared --prefix=/usr/local/ffmpeg --extra-cflags=-I/usr/local/x264/include --extra-ldflags=-L/usr/local/x264/lib

make && make install

如果linux下出现 ffmpeg: error while loading shared libraries: libavdevice.so.55: cannot open shared object file: No such file or directory

vi /etc/ld.so.conf

加入:/usr/local/ffmpeg/lib

执行:ldconfig

切本地文件命令:ffmpeg -i test.ts -c copy -map 0 -f segment -segment_list playlist.m3u8 -segment_time 10 output%03d.ts

切网络地址命令:ffmpeg -i rtmp://192.168.42.128/myapp/test1 -c copy -map 0 -f segment -segment_list playlist.m3u8 -segment_time 10 output%03d.ts

设置视频编码库libx264和音频编码库libfaac:

./ffmpeg -y -i rtmp://192.168.42.128/myapp/test1 -pix_fmt yuv420p -vcodec libx264 -acodec libfaac -r 25 -profile:v baseline -b:v 150k -maxrate 200k -force_key_frames 50 -s 320x240 -map 0 -flags -global_header -f segment -segment_list playlist.m3u8 -segment_time 10 -segment_format mpeg_ts -segment_list_type m3u8 segment%05d.ts

6. nginx-rtmp-module切片

application hls {

live on;

hls on;

hls_path /project/nginx-rtmp-module-master/test/rtmp-publisher;

}

7.nginx实时rtmp播放地址

http://192.168.42.128/player.html

http://192.168.42.128/stat

8.HLS实时播放地址

http://192.168.42.128/playlist.m3u8

(转)nginx-rtmp-module和ffmpeg搭建实时HLS切片的更多相关文章

  1. 解决RTMP推送时间戳问题引起HLS切片不均匀导致手机浏览器播放卡顿的问题

    本文转自EasyDarwin开源团队成员Kim的博客:http://blog.csdn.net/jinlong0603/article/details/74161115 引言 最近在测试EasyNVR ...

  2. ffmpeg,rtmpdump和nginx rtmp实现录屏,直播和录制

    公司最近在做视频直播的项目,我这里分配到对直播的视频进行录制,录制的方式是通过rtmpdump对rtmp的视频流进行录制 前置的知识 ffmpeg: 用于实现把录屏工具发出的视频和音频流,转换成我们需 ...

  3. (转)Nginx+rtmp+ffmpeg搭建流媒体服务器

    (1)下载第三方扩展模块nginx-rtmp-module # mkdir module && cd module //创建一个存放模块的目录 # wget https://githu ...

  4. 三、Windows下用FFmpeg+nginx+rtmp搭建直播环境 实现推流、拉流

    一.环境 1.开发环境:windows 2.开发工具:FFmpeg.nginx.nginx-rmtp-module (链接:https://pan.baidu.com/s/119d2GeMzddas_ ...

  5. centos7+nginx+rtmp+ffmpeg搭建流媒体服务器(保存流目录与http目录不要随意配置,否则有权限问题)

    搭建nginx-http-flv-module升级代替rtmp模块,详情:https://github.com/winshining/nginx-http-flv-module/blob/master ...

  6. 基于Nginx+nginx-rtmp-module+ffmpeg搭建rtmp、hls流媒体服务器

    上篇文章是基于Red5与ffmpeg实现rtmp处理NVR或摄像头的监控视频处理方案,有兴趣的朋友可以查看. Nginx及nginx-rtmp-module安装 新建目录 mkdir /usr/loc ...

  7. nginx::基于Nginx+nginx-rtmp-module+ffmpeg搭建rtmp、hls流媒体服务器

    待续 ffmpeg -re -i "/home/bk/hello.mp4" -vcodec libx264 -vprofile baseline -acodec aac -ar 4 ...

  8. Android中直播视频技术探究之---视频直播服务端环境搭建(Nginx+RTMP)

    一.前言 前面介绍了Android中视频直播中的一个重要类ByteBuffer,不了解的同学可以 点击查看 到这里开始,我们开始动手开发了,因为我们后续肯定是需要直播视频功能,然后把视频推流到服务端, ...

  9. Linux-Nginx+rtmp+ffmpeg搭建流媒体服务器

    Nginx+rtmp+ffmpeg搭建流媒体服务器 说明: nginx搭建流媒体服务需要用到 nginx-rtmp-module 模块 具体操作步骤: 安装nginx (1)下载第三方扩展模块ngin ...

随机推荐

  1. Linux shell 提取文件名和目录名的一些方法(转)

    很多时候在使用Linux的shell时,我们都需要对文件名或目录名进行处理,通常的操作是由路径中提取出文件名,从路径中提取出目录名,提取文件后缀名等等.例如,从路径/dir1/dir2/file.tx ...

  2. iOS 给三方日历加上农历

    首先创建一个农历文件 LunarCalendar.h // // LunarCalendar.h // Hnair4iPhone // // Created by yingkong1987 on 13 ...

  3. UVA 133“The Dole Queue”(循环报数处理技巧)

    •参考资料 [1]:紫书P82 •题意(by紫书) 按照被选中的次序输出这 n 个人的编号: 如果A和B选中的是同一个人,输出一个这个人的编号: 输出格式:输出的每个编号占3个字节,不够3个字节在前面 ...

  4. 通达OA 小飞鱼工作流在线培训教程(七)工作流应用的意义及基础设置(图文)

    这个课程计划已经有一段时间了,经过这段时间结合实际网络教学又进行了一些总结,这里将陆续为大家呈现相关的工作流设计开发课程. 同一时候线上的视频教学课程也将立即上线,欢迎朋友们的关注. 首先介绍一些工作 ...

  5. String转Map的工具类

    借鉴代码 public class StringToMapUtil { public static Map<String, String> getValue(String param) { ...

  6. curses.h头文件不存在解决办法

    sudo apt-get install libncurses5-dev安装,系统自带库文件一般在/usr/include下面,这个是安装curses.h的 conio不是c语言标准库,也不是posi ...

  7. mycat 分页慢原理解析、mycat跨事务解惑、mycat注解调用存储过程分析

    1结合Mycat日志,分析select * from travelrecord order by id limit100000,100 的运行过程,解释下当limit M,N中的M非常大的情况下.为什 ...

  8. vue.js+koa2项目实战(一)创建项目和elementUI配置

    前端采用vuex+element-ui: 后端采用koa2+restfulAPI+sequlize: (一)项目介绍 宠物社区 1.社区 2.好友 3.说说 4.宠粮 5.健康 (二)项目框架 1.V ...

  9. 面试题:使用finalkeyword修饰一个变量时,是引用不能变,还是引用的对象不能变?

    /* * 问题:使用finalkeyword修饰一个变量时,是引用不能变,还是引用的对象不能变 * 答: * 使用finalkeyword修饰一个变量时,是指引用变量不能变,引用变量所指向的对象中的内 ...

  10. OOA/OOD/OOP的区别

    http://javajiao.iteye.com/blog/152956这是一个故事: "工程師修了一條隧道,隧道的一端就是美麗的風景,很多人會開車通過隧道.雖然隧道內已經有燈了,但是設計 ...