视频拉流 Linux安装FFmpeg
1 下载最新源码包并解压
$ wget http://ffmpeg.org/releases/ffmpeg-3.1.3.tar.bz2
$ tar jxvf ffmpeg-3.1..tar.bz2
2安装yasm
$ yum install gcc
$ yum install yasm
3安装ffmpeg
$ cd ffmpeg-3.1.3
$ ./configure
$ make
$ make install
4安装成功
输入ffmpeg打印了相关信息,表示安装成功
# ffmpeg
ffmpeg version 3.1. Copyright (c) - the FFmpeg developers
built with gcc 4.8. (GCC) (Red Hat 4.8.-)
configuration:
libavutil . 28.100 / . 28.100
libavcodec . 48.101 / . 48.101
libavformat . 41.100 / . 41.100
libavdevice . 0.101 / . 0.101
libavfilter . 47.100 / . 47.100
libswscale . 1.100 / . 1.100
libswresample . 1.100 / . 1.100
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'
安装nginx-rtmp
1下载nginx-rtmp-module
yum install git git clone https://github.com/arut/nginx-rtmp-module.git
2下载编译nginx
yum -y install pcre-devel
yum -y install openssl openssl-devel
yum install gcc gcc-c++
wget http://nginx.org/download/nginx-1.8.1.tar.gz
tar -zxvf nginx-1.8..tar.gz
cd nginx-1.8.
./configure --prefix=/usr/local/nginx --add-module=../nginx-rtmp-module --with-http_ssl_module
make && make install
修改nginx.conf
#user nobody;
worker_processes ; #error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info; #pid logs/nginx.pid; events {
worker_connections ;
}
rtmp { server { listen ; chunk_size ; # TV mode: one publisher, many subscribers
application mylive { # enable live streaming
live on; }
}
} http {
include mime.types;
default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on;
#tcp_nopush on; #keepalive_timeout ;
keepalive_timeout ; #gzip on; server {
listen ;
server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / {
root html;
index index.html index.htm;
} #error_page /.html; # redirect server error pages to the static page /50x.html
#
error_page /50x.html;
location = /50x.html {
root html;
} # proxy the PHP scripts to Apache listening on 127.0.0.1:
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
# include fastcgi_params;
#} # deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
} # another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen ;
# listen somename:;
# server_name somename alias another.alias; # location / {
# root html;
# index index.html index.htm;
# }
#} # HTTPS server
#
#server {
# listen ssl;
# server_name localhost; # ssl_certificate cert.pem;
# ssl_certificate_key cert.key; # ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m; # ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on; # location / {
# root html;
# index index.html index.htm;
# }
#} }
执行拉流
ffmpeg -re -rtsp_transport tcp -i 'rtsp://11*.10:9090/dss/monitor/params?cameraid=1000118$0&substream=1' -vcodec copy -vprofile baseline -strict - -f flv -s 1280x720 -q 'rtmp://15*2:28099/mylive/wangyong'
拉流保持文件
ffmpeg -re -rtsp_transport tcp -i "rtsp://IP:9090/dss/monitor/params?cameraid=1000101$0&substream=1" -vcodec copy D:\out.avi
拉流提取图片
ffmpeg -re -rtsp_transport tcp -i "rtsp://IP:9090/dss/monitor/params?cameraid=1000102$0&substream=1" -r 1 -f image2 "D:\wy1111.jpg" ffmpeg -i "D:\out.avi" -r -f image2 "D:\wy.jpg"
根据时间提取文件
ffmpeg.exe -ss :: -t :: -i "D:\out.avi" -vcodec copy -acodec copy "D:\out-wy.avi"
视频拉流 Linux安装FFmpeg的更多相关文章
- javacpp-FFmpeg系列之2:通用拉流解码器,支持视频拉流解码并转换为YUV、BGR24或RGB24等图像像素数据
javacpp-ffmpeg系列: javacpp-FFmpeg系列之1:视频拉流解码成YUVJ420P,并保存为jpg图片 javacpp-FFmpeg系列之2:通用拉流解码器,支持视频拉流解码并转 ...
- javacpp-FFmpeg系列之1:视频拉流解码成YUVJ420P,并保存为jpg图片
javacpp-ffmpeg系列: javacpp-FFmpeg系列之1:视频拉流解码成YUVJ420P,并保存为jpg图片 javacpp-FFmpeg系列之2:通用拉流解码器,支持视频拉流解码并转 ...
- iOS - 直播流程,视频推流,视频拉流,简介,SMTP、RTMP、HLS、 PLPlayerKit
收藏笔记 1 . 音视频处理的一般流程: 数据采集→数据编码→数据传输(流媒体服务器) →解码数据→播放显示1.数据采集:摄像机及拾音器收集视频及音频数据,此时得到的为原始数据涉及技术或协议:摄像机: ...
- 【转】直播流程,视频推流,视频拉流,简介,SMTP、RTMP、HLS、 PLPlayerKit
原:https://www.cnblogs.com/baitongtong/p/11248966.html 1 .音视频处理的一般流程: 数据采集→数据编码→数据传输(流媒体服务器) →解码数据→播放 ...
- Linux安装ffmpeg
1.安装ffmpeg 简单步骤: A.首先去官网下载源码包,我的是ffmpeg-3.4.tar.bz2,下载之后上传至Linux准备安装,首先解压安装包: tar -xjvf ffmpeg-3.4 ...
- Linux 安装 ffmpeg
在安装ffmpeg之前,需要先安装一些必需组件.包括但不限于以下组件(有的系统里面可能已经安装过) 首先在根目录下创建:ffmpeg_sources 1.Yasm sudo apt-get insta ...
- 海康&大华&DSS视频拉流-RTSP转RTMP多媒体播放技术
海康&大华&DSS获取RTSP 实时流 海康:rtsp://[username]:[password]@[ip]:[port]/[codec]/[channel]/[subtype]/ ...
- javacpp-FFmpeg系列补充:FFmpeg拉流截图实现在线演示demo(视频截图并返回base64图像,支持jpg/png/gif/bmp等多种格式)
javacpp-ffmpeg系列: javacpp-FFmpeg系列之1:视频拉流解码成YUVJ420P,并保存为jpg图片 javacpp-FFmpeg系列之2:通用拉流解码器,支持视频拉流解码并转 ...
- linux(php环境) 安装ffmpeg
实现上传视频获取视频的第一帧当做视频封面 1.安装ffmpeg ffmpeg的下载链接 https://ffmpeg.org/download.html 解压安装包 tar -jxvf ffmpeg ...
随机推荐
- SSIS - 6.序列容器和优先约束
一.多样的优先约束(看例子) 1)打开一个空白的SSIS包,拖拽4个脚本任务到设计面板上,重命名后连接起来,如下图所示. 2)执行包,可以看到任务执行成功.之后我们改变C和D之间的优先约束为“失败”. ...
- Mesos源码分析(3): Mesos Master的启动之二
2. process::firewall::install(move(rules));如果有参数--firewall_rules则会添加规则 对应的代码如下: // Initialize fire ...
- spring的定时器
一:基于xml配置的方式 1:编写普通的pojo 类 package com.aflyun.web.task; import org.springframework.stereotype.Compon ...
- [Swift]LeetCode725. 分隔链表 | Split Linked List in Parts
Given a (singly) linked list with head node root, write a function to split the linked list into k c ...
- 花点时间顺顺Git(下)
### 进入正文前插个楼,因为vim的操作下面会频繁用到 vim的操作 1.输入i进入插入模式,对上一条commit信息的内容进行修改 2.按下ESC键,退出编辑模式,切换到命令模式. 3.保存修改并 ...
- RSA算法原理——(1)目前常见加密算法简介
艾伦·麦席森·图灵在二战期间主要负责破译德国人的密码系统Enigma,破解密码需要大量的计算,图灵深知工欲善其事必先利其器的道理,于是一台叫作CO-LOSSUS的计算机在1943年被研制出来,后来 ...
- 【Spark篇】---Spark中广播变量和累加器
一.前述 Spark中因为算子中的真正逻辑是发送到Executor中去运行的,所以当Executor中需要引用外部变量时,需要使用广播变量. 累机器相当于统筹大变量,常用于计数,统计. 二.具体原理 ...
- BBS论坛(十二)
12.1.图形验证码生成 (1)utils/captcha/init.py import random import string # Image:一个画布 # ImageDraw:一个画笔 # Im ...
- "无需开发经验" 也能拥有小程序
本文分享嘉宾:毛帅,又拍图片管家资深开发工程师,主要负责又拍图片管家.图管小程序第三方平台.图管小程序等项目的开发.维护及拓新工作.熟悉 JS / C++ 等语言,有丰富的 NodeJS 开发经验,热 ...
- css3的动画特效--元素旋转(transition,animation)
开发中,视觉要你实现一个元素的旋转问题,比如说如下图所示: 思路:首先动画动效肯定离不开anmimation动画. 和transition动画一样,animation动画也是CSS3动画的一种,这类动 ...