部署ffmpeg-from_git

从git上下载部署ffmpeg,记录一下过程;之前部署是找的一个个tar包安装的,可能使用git下载的方法更便捷一些。

[root@ip-172-31-32-239 ~]# cat /etc/redhat-release 
CentOS Linux release 7.8.2003 (Core)
  1. 下载

https://ffmpeg.org/download.html
在这里插入图片描述

git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
  1. 编译安装
./configure --disable-x86asm
make
  1. 验证
[root@ip-172-31-32-239 ffmpeg]# ./ffmpeg -version
ffmpeg version N-103896-ged65498 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
configuration: --disable-x86asm
libavutil      57.  7.100 / 57.  7.100
libavcodec     59.  9.101 / 59.  9.101
libavformat    59.  5.100 / 59.  5.100
libavdevice    59.  0.101 / 59.  0.101
libavfilter     8.  9.100 /  8.  9.100
libswscale      6.  1.100 /  6.  1.100
libswresample   4.  0.100 /  4.  0.100

在这里插入图片描述

推流:

[root@ip-172-31-32-239 ffmpeg]# ./ffmpeg -re -i /root/video/7abdb5c0-16bb-11ec-870f-0a72f23d29fe.mp4 -f flv -y rtmp://52.82.0.189:1935/live/teststream
ffmpeg version N-103896-ged65498 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-44)
  configuration: --disable-x86asm
  libavutil      57.  7.100 / 57.  7.100
  libavcodec     59.  9.101 / 59.  9.101
  libavformat    59.  5.100 / 59.  5.100
  libavdevice    59.  0.101 / 59.  0.101
  libavfilter     8.  9.100 /  8.  9.100
  libswscale      6.  1.100 /  6.  1.100
  libswresample   4.  0.100 /  4.  0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/root/video/7abdb5c0-16bb-11ec-870f-0a72f23d29fe.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.20.100
  Duration: 00:08:00.05, start: 0.000000, bitrate: 2019 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 1982 kb/s, 25 fps, 25 tbr, 90k tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 30 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> flv1 (flv))
  Stream #0:1 -> #0:1 (aac (native) -> adpcm_swf (native))
Press [q] to stop, [?] for help
Output #0, flv, to 'rtmp://52.82.0.189:1935/live/teststream':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf59.5.100
  Stream #0:0(und): Video: flv1 ([2][0][0][0] / 0x0002), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 200 kb/s, 25 fps, 1k tbn (default)
    Metadata:
      handler_name    : VideoHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.9.101 flv
    Side data:
      cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A
  Stream #0:1(und): Audio: adpcm_swf ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 352 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
      vendor_id       : [0][0][0][0]
      encoder         : Lavc59.9.101 adpcm_swf
[flv @ 0x318a4c0] Failed to update header with correct duration.ate=3493.5kbits/s speed=0.972x    
[flv @ 0x318a4c0] Failed to update header with correct filesize.
frame=12000 fps= 24 q=31.0 Lsize=  204745kB time=00:08:00.09 bitrate=3493.6kbits/s speed=0.972x    
video:183775kB audio:20701kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.131387%

在这里插入图片描述
观看:
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值