1 下载最新源码包并解压

  1. $ wget http://ffmpeg.org/releases/ffmpeg-3.1.3.tar.bz2
  2. $ tar jxvf ffmpeg-3.1..tar.bz2

2安装yasm

  1. $ yum install gcc
    $ yum install yasm

3安装ffmpeg

  1. $ cd ffmpeg-3.1.3
  2. $ ./configure
  3. $ make
  4. $ make install

4安装成功

输入ffmpeg打印了相关信息,表示安装成功

  1. # ffmpeg
  2. ffmpeg version 3.1. Copyright (c) - the FFmpeg developers
  3. built with gcc 4.8. (GCC) (Red Hat 4.8.-)
  4. configuration:
  5. libavutil . 28.100 / . 28.100
  6. libavcodec . 48.101 / . 48.101
  7. libavformat . 41.100 / . 41.100
  8. libavdevice . 0.101 / . 0.101
  9. libavfilter . 47.100 / . 47.100
  10. libswscale . 1.100 / . 1.100
  11. libswresample . 1.100 / . 1.100
  12. Hyper fast Audio and Video encoder
  13. usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...
  14.  
  15. Use -h to get full help or, even better, run 'man ffmpeg'

安装nginx-rtmp

1下载nginx-rtmp-module

  1. yum install git
  2.  
  3. git clone https://github.com/arut/nginx-rtmp-module.git

2下载编译nginx

  1. yum -y install pcre-devel
  2. yum -y install openssl openssl-devel
  3. yum install gcc gcc-c++
    wget http://nginx.org/download/nginx-1.8.1.tar.gz
  4. tar -zxvf nginx-1.8..tar.gz
  5. cd nginx-1.8.
  6. ./configure --prefix=/usr/local/nginx --add-module=../nginx-rtmp-module --with-http_ssl_module
  7. make && make install
  1. 修改nginx.conf
  1. #user nobody;
  2. worker_processes ;
  3.  
  4. #error_log logs/error.log;
  5. #error_log logs/error.log notice;
  6. #error_log logs/error.log info;
  7.  
  8. #pid logs/nginx.pid;
  9.  
  10. events {
  11. worker_connections ;
  12. }
  13. rtmp {
  14.  
  15. server {
  16.  
  17. listen ;
  18.  
  19. chunk_size ;
  20.  
  21. # TV mode: one publisher, many subscribers
  22. application mylive {
  23.  
  24. # enable live streaming
  25. live on;
  26.  
  27. }
  28. }
  29. }
  30.  
  31. http {
  32. include mime.types;
  33. default_type application/octet-stream;
  34.  
  35. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  36. # '$status $body_bytes_sent "$http_referer" '
  37. # '"$http_user_agent" "$http_x_forwarded_for"';
  38.  
  39. #access_log logs/access.log main;
  40.  
  41. sendfile on;
  42. #tcp_nopush on;
  43.  
  44. #keepalive_timeout ;
  45. keepalive_timeout ;
  46.  
  47. #gzip on;
  48.  
  49. server {
  50. listen ;
  51. server_name localhost;
  52.  
  53. #charset koi8-r;
  54.  
  55. #access_log logs/host.access.log main;
  56.  
  57. location / {
  58. root html;
  59. index index.html index.htm;
  60. }
  61.  
  62. #error_page /.html;
  63.  
  64. # redirect server error pages to the static page /50x.html
  65. #
  66. error_page /50x.html;
  67. location = /50x.html {
  68. root html;
  69. }
  70.  
  71. # proxy the PHP scripts to Apache listening on 127.0.0.1:
  72. #
  73. #location ~ \.php$ {
  74. # proxy_pass http://127.0.0.1;
  75. #}
  76.  
  77. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:
  78. #
  79. #location ~ \.php$ {
  80. # root html;
  81. # fastcgi_pass 127.0.0.1:;
  82. # fastcgi_index index.php;
  83. # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  84. # include fastcgi_params;
  85. #}
  86.  
  87. # deny access to .htaccess files, if Apache's document root
  88. # concurs with nginx's one
  89. #
  90. #location ~ /\.ht {
  91. # deny all;
  92. #}
  93. }
  94.  
  95. # another virtual host using mix of IP-, name-, and port-based configuration
  96. #
  97. #server {
  98. # listen ;
  99. # listen somename:;
  100. # server_name somename alias another.alias;
  101.  
  102. # location / {
  103. # root html;
  104. # index index.html index.htm;
  105. # }
  106. #}
  107.  
  108. # HTTPS server
  109. #
  110. #server {
  111. # listen ssl;
  112. # server_name localhost;
  113.  
  114. # ssl_certificate cert.pem;
  115. # ssl_certificate_key cert.key;
  116.  
  117. # ssl_session_cache shared:SSL:1m;
  118. # ssl_session_timeout 5m;
  119.  
  120. # ssl_ciphers HIGH:!aNULL:!MD5;
  121. # ssl_prefer_server_ciphers on;
  122.  
  123. # location / {
  124. # root html;
  125. # index index.html index.htm;
  126. # }
  127. #}
  128.  
  129. }

执行拉流

  1. 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'

拉流保持文件

  1. ffmpeg -re -rtsp_transport tcp -i "rtsp://IP:9090/dss/monitor/params?cameraid=1000101$0&substream=1" -vcodec copy D:\out.avi

拉流提取图片

  1. ffmpeg -re  -rtsp_transport tcp -i "rtsp://IP:9090/dss/monitor/params?cameraid=1000102$0&substream=1" -r 1 -f image2 "D:\wy1111.jpg"
  2.  
  3. ffmpeg -i "D:\out.avi" -r -f image2 "D:\wy.jpg"

根据时间提取文件

  1. ffmpeg.exe -ss :: -t :: -i "D:\out.avi" -vcodec copy -acodec copy "D:\out-wy.avi"

视频拉流 Linux安装FFmpeg的更多相关文章

  1. javacpp-FFmpeg系列之2:通用拉流解码器,支持视频拉流解码并转换为YUV、BGR24或RGB24等图像像素数据

    javacpp-ffmpeg系列: javacpp-FFmpeg系列之1:视频拉流解码成YUVJ420P,并保存为jpg图片 javacpp-FFmpeg系列之2:通用拉流解码器,支持视频拉流解码并转 ...

  2. javacpp-FFmpeg系列之1:视频拉流解码成YUVJ420P,并保存为jpg图片

    javacpp-ffmpeg系列: javacpp-FFmpeg系列之1:视频拉流解码成YUVJ420P,并保存为jpg图片 javacpp-FFmpeg系列之2:通用拉流解码器,支持视频拉流解码并转 ...

  3. iOS - 直播流程,视频推流,视频拉流,简介,SMTP、RTMP、HLS、 PLPlayerKit

    收藏笔记 1 . 音视频处理的一般流程: 数据采集→数据编码→数据传输(流媒体服务器) →解码数据→播放显示1.数据采集:摄像机及拾音器收集视频及音频数据,此时得到的为原始数据涉及技术或协议:摄像机: ...

  4. 【转】直播流程,视频推流,视频拉流,简介,SMTP、RTMP、HLS、 PLPlayerKit

    原:https://www.cnblogs.com/baitongtong/p/11248966.html 1 .音视频处理的一般流程: 数据采集→数据编码→数据传输(流媒体服务器) →解码数据→播放 ...

  5. Linux安装ffmpeg

      1.安装ffmpeg 简单步骤: A.首先去官网下载源码包,我的是ffmpeg-3.4.tar.bz2,下载之后上传至Linux准备安装,首先解压安装包: tar -xjvf ffmpeg-3.4 ...

  6. Linux 安装 ffmpeg

    在安装ffmpeg之前,需要先安装一些必需组件.包括但不限于以下组件(有的系统里面可能已经安装过) 首先在根目录下创建:ffmpeg_sources 1.Yasm sudo apt-get insta ...

  7. 海康&大华&DSS视频拉流-RTSP转RTMP多媒体播放技术

    海康&大华&DSS获取RTSP 实时流 海康:rtsp://[username]:[password]@[ip]:[port]/[codec]/[channel]/[subtype]/ ...

  8. javacpp-FFmpeg系列补充:FFmpeg拉流截图实现在线演示demo(视频截图并返回base64图像,支持jpg/png/gif/bmp等多种格式)

    javacpp-ffmpeg系列: javacpp-FFmpeg系列之1:视频拉流解码成YUVJ420P,并保存为jpg图片 javacpp-FFmpeg系列之2:通用拉流解码器,支持视频拉流解码并转 ...

  9. linux(php环境) 安装ffmpeg

    实现上传视频获取视频的第一帧当做视频封面 1.安装ffmpeg ffmpeg的下载链接  https://ffmpeg.org/download.html 解压安装包 tar -jxvf ffmpeg ...

随机推荐

  1. Android Studio 设置不同分辨率的图标Icon

    右键你的项目 -->"NEW"-->"Image Asset" 'Asset Type' 勾选”Image“才可以选择”Path“,其他选项可以自己 ...

  2. Android简单计时器

    本文利用ContextMenu(上下文菜单),Chronometer实现简单计数器. Main.xml: <?xml version="1.0" encoding=" ...

  3. SQL Server 恢复数据库至指定时间点

    发生数据库误删的情况下,及时恢复数据到误操作前的状态 工具/原料   SQL Server Management Studio 数据库完整备份及日志备份 必备条件   1 数据库右键属性,在选项中查看 ...

  4. 操作系统中 heap 和 stack 的区别

    操作系统中 heap 和 stack 的区别heap 和 stack是什么堆栈是两种数据结构.堆栈都是一种数据项按序排列的数据结构,只能在一端(称为栈顶(top))对数据项进行插入和删除.==在单片机 ...

  5. Web安全之XSS Platform搭建及使用实践

    Web安全之XSS Platform搭建及使用实践 一.背景 XSS Platform 是一个非常经典的XSS渗透测试管理系统,原作者在2011年所开发,由于后来长时间没有人维护,导致目前在PHP7环 ...

  6. sweetalert提示框

    文档 sweetalert Api:http://t4t5.github.io/sweetalert/ 开源项目源码:https://github.com/t4t5/sweetalert 在文件中首先 ...

  7. [Swift]LeetCode287. 寻找重复数 | Find the Duplicate Number

    Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), pro ...

  8. [Swift]LeetCode306. 累加数 | Additive Number

    Additive number is a string whose digits can form additive sequence. A valid additive sequence shoul ...

  9. [Swift]LeetCode887. 鸡蛋掉落 | Super Egg Drop

    You are given K eggs, and you have access to a building with N floors from 1 to N. Each egg is ident ...

  10. Maven项目执行java入口main方法

    在Maven项目中配置pom.xml文件加载maven-surefire-plugin插件来执行testng.xml,相信大家对此种用法已经非常熟悉了.但是有些场景可能需要我们去加载执行java的ma ...