视频拉流 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 ...
随机推荐
- tomcat +jenkios
来源:https://www.cnblogs.com/edward2013/p/5269465.html 1. 安装JDK JDK下载地址: http://www.oracle.com/techne ...
- QEMU KVM Libvirt手册(6) – Network Block Device
网络块设备是通过NBD Server将虚拟块设备通过TCP/IP export出来,可以远程访问. NBD Server通常是qemu-nbd 可以提供unix socket qemu-nbd -t ...
- vue-router路径计算问题
简书原文 昨天刚刚发表了一个前端跨域新方案尝试,今天在开发中就遇到的了问题. 起因 前端使用的是vue-router组件的history模式,但是由于我们的整个页面都是从static(静态资源站)lo ...
- Spring Cloud,Dubbo及HSF对比
Round 1:背景 Dubbo,是阿里巴巴服务化治理的核心框架,并被广泛应用于阿里巴巴集团的各成员站点.阿里巴巴近几年对开源社区的贡献不论在国内还是国外都是引人注目的,比如:JStorm捐赠给Apa ...
- Python微信公众号开发—小白篇
本文面向想通过Python学习公众号开发的同学.一站式解决新手开发微信公众号遇到的所有问题. 为了防止我的文章被到处转载,贴一下我的公众号[智能制造专栏],欢迎大家关注. github仓库地址http ...
- 【从零开始搭建自己的.NET Core Api框架】(四)实战!带你半个小时实现接口的JWT授权验证
系列目录 一. 创建项目并集成swagger 1.1 创建 1.2 完善 二. 搭建项目整体架构 三. 集成轻量级ORM框架——SqlSugar 3.1 搭建环境 3.2 实战篇:利用SqlSuga ...
- [Swift]LeetCode301. 删除无效的括号 | Remove Invalid Parentheses
Remove the minimum number of invalid parentheses in order to make the input string valid. Return all ...
- Python必备库
Python必备库 --default-timeout=100避免网络延迟错误:-U给管理员权限. Python基础库 pip --default-timeout=100 install -U pyg ...
- 微信小程序实战–集阅读与电影于一体的小程序项目(八)
31.电影详情页面 movie-template.wxml <view class="movie-container" catchtap="onMovieTap&q ...
- 10.Flask上下文
1.1.local线程隔离对象 不用local对象的情况 from threading import Thread request = ' class MyThread(Thread): def ru ...