视频拉流 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 ...
随机推荐
- Java互联网架构-直播互动平台高并发分布式架构应用设计
概述 网页HTML 静态化: 其实大家都知道网页静态化,效率最高,消耗最小的就是纯静态化的 html 页面,所以我们尽可能使我们的网站上的页面采用静态页面来实现,这个最简单的方法其实也是最有效的方法, ...
- 【Nim游戏】高僧斗法
先来看看Nim定理: // 若干堆硬币,二人轮流取,从一堆硬币中取几个 直到某个人不能取硬币 那这个人就输了 // 3 4 5 // 3 3 把硬币变成相同的 那么你就赢了 因为你可以跟着另一个人一样 ...
- [Java]LeetCode117. 填充同一层的兄弟节点 II | Populating Next Right Pointers in Each Node II
Given a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *nex ...
- [Swift]LeetCode187. 重复的DNA序列 | Repeated DNA Sequences
All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACG ...
- [Swift]LeetCode757. 设置交集大小至少为2 | Set Intersection Size At Least Two
An integer interval [a, b] (for integers a < b) is a set of all consecutive integers from ato b, ...
- [Swift]LeetCode841. 钥匙和房间 | Keys and Rooms
There are N rooms and you start in room 0. Each room has a distinct number in 0, 1, 2, ..., N-1, an ...
- Npoi简单读写Excel
什么是NPOI ? 简而言之,NPOI就是可以在没有Office的情况下对Word或Excel文档进行读写等操作. 使用方式 : 1.准备NPOI的dll文件 下载链接:https://npoi.co ...
- Kubernetes系列之监控Metres-server实战篇
本次系列使用的所需部署包版本都使用的目前最新的或最新稳定版,安装包地址请到公众号内回复[K8s实战]获取 介绍 从 Kubernetes 1.8 开始,Kubernetes 通过 Metrics AP ...
- spring统一错误响应设置
在类入口增加 @RestControllerAdvice注解.可以用于定义@ExceptionHandler.@InitBinder.@ModelAttribute,并应用到所有@RequestMap ...
- java集合框架整理
一.总体框架 Java集合是java提供的工具包,包含了常用的数据结构:集合.链表.队列.栈.数组.映射等.Java集合工具包位置是java.util.* .Java集合主要可以划分为4个部分:Lis ...