从git上下载部署ffmpeg,记录一下过程;之前部署是找的一个个tar包安装的,可能使用git下载的方法更便捷一些。
[root@ip-172-31-32-239 ~]# cat /etc/redhat-release
CentOS Linux release 7.8.2003 (Core)
- 下载
https://ffmpeg.org/download.html
git clone https://git.ffmpeg.org/ffmpeg.git ffmpeg
- 编译安装
./configure --disable-x86asm
make
- 验证
[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%
观看: