怎么在 Linux 下运行 smart_rtmpd
怎么在 Linux 下运行 smart_rtmpd
操作系统的准备
我们知道比较流行的 Linux 操作系统基本上分为两类,一类是以 Redhat 为基线的 Redhat, CentOS;另一类是 Debian 为基线的 Debian,Ubuntu。当然现在还有一些新兴势力 Arch Linux,但大家都是基于 Linux 内核进行封装运作的。主要表现是包管理器不同,面向的用户场景不同,有的往桌面方面发展,有的往嵌入式方向发展。这些系统大家可以根据自己的喜好进行选择,本文不做过多阐述,差异不大。建议大家采用操作系统最新版本,这样系统性能更好,功能更强大,兼容性更好,性能也是最佳。
smart_rtmpd 服务器软件的准备
软件的下载
访问 https://github.com/superconvert/smart_rtmpd , 下载 https://github.com/superconvert/smart_rtmpd/blob/master/rtmpd.zip 或 https://github.com/superconvert/smart_rtmpd/releases
访问 https://gitee.com/superconvert/smart_rtmpd , 下载 https://gitee.com/superconvert/smart_rtmpd/blob/master/rtmpd.zip软件包的介绍
下载的软件包 rtmpd.zip 里面包含不同平台的安装运行包smart_rtmpd.coroutines.centos7.7.1908.x64.tar.gz CentOS 系统的协程版本 (x64)
smart_rtmpd.multithread.centos7.7.1908.x64.tar.gz CentOS 系统的多线程版本 (x64) --- 推荐
smart_rtmpd.coroutines.ubuntu16.04LTS.x64.tar.gz Ubuntu 系统的协程版本 (x64)
smart_rtmpd.multithread.ubuntu16.04LTS.x64.tar.gz Ubuntu 系统的多线程版本 (x64)
smart_rtmpd.multithread.generic.aarch64.tar.gz ARM-v8 架构的多线程版本 (arm)
软件包的准备
我们下载 rtmpd.zip 后进行解压,把 smart_rtmpd.multithread.centos7.7.1908.x64.tar.gz 上传到我们的 Linux 操作系统内,进行解压[root@localhost ~]# mkdir smart_rtmpd
[root@localhost ~]# tar zxvf smart_rtmpd.multithread.centos7.7.1908.x64.tar.gz -C smart_rtmpd
[root@localhost ~]# cd smart_rtmpd
[root@localhost smart_rtmpd]# ls -alh
total 8.0M
drwxr-xr-x. 3 root root 167 Aug 15 05:34 .
drwxr-xr-x. 4 root root 28 Aug 15 05:34 ..
-rw-r--r--. 1 root root 9.7K Aug 14 18:12 config.xml
-rw-r--r--. 1 root root 378 Jul 23 12:24 gb28181.xml
drwxr-xr-x. 4 root root 100 Aug 15 03:43 html
-rw-r--r--. 1 root root 234 Aug 17 2021 ice_server.json
-rw-r--r--. 1 root root 173 Feb 17 2023 mime.xml
-rw-r--r--. 1 root root 2.8K Jul 4 2021 policy.xml
-rw-r--r--. 1 root root 1.6K Aug 9 2021 server.crt
-rw-r--r--. 1 root root 1.7K Aug 9 2021 server.key
-rwxr-xr-x. 1 root root 8.0M Aug 15 04:08 smart_rtmpd // 确保 smart_rtmpd 是可执行的
为什么选用 smart_rtmpd.multithread.centos7.7.1908.x64.tar.gz 版本,这个应该是通用版本,应该适用用大部分 Linux 系统,无论是 CentOS, Ubuntun, Arch Linux
运行 smart_rtmpd
我们准备运行 smart_rtmpd 流媒体服务器问题1 :smart_rtmpd 没有可执行权限,通过 chmod 赋权
[root@localhost smart_rtmpd]# ./smart_rtmpd
-bash: ./smart_rtmpd: Permission denied // 大部分这种情况是 smart_rtmpd 拷贝复制过程中丢失了可执行权限
[root@localhost smart_rtmpd]# chmod +x ./smart_rtmpd 问题2 :端口被其它程序占用,需要通过 config.xml 更改端口,或者停止其它的程序
[root@localhost bin]# ./smart_rtmpd
EAB7D740 [24-12-31 14:15:02.161] I: smart_rtmpd --- build time : 2024-08-15 04:06:58
EAB7D740 [24-12-31 14:15:02.161] I: website url : http://www.qiyicc.com/download/rtmpd.zip
EAB7D740 [24-12-31 14:15:02.161] I: gitee url : https://gitee.com/mirrors/smart-rtmpd
EAB7D740 [24-12-31 14:15:02.161] I: github url : https://github.com/superconvert/smart_rtmpd
EAB7D740 [24-12-31 14:15:02.161] I: liveshow url : https://github.com/superconvert/smart_rtmpd/blob/master/liveshow.md
EAB7D740 [24-12-31 14:15:02.161] I: development url : https://github.com/superconvert/smart_rtmpd/blob/master/web_dev.md
EAB7D740 [24-12-31 14:15:02.161] I: examples url : https://github.com/superconvert/smart_rtmpd/tree/master/example
EAB7D740 [24-12-31 14:15:02.161] I: email : cwf12345@sina.com
EAB7D740 [24-12-31 14:15:02.161] I: webchat : 99766553, qq : 99766553
EAB7D740 [24-12-31 14:15:02.161] I: 192.168.161.136 ens33
EAB7D740 [24-12-31 14:15:02.221] I: ssl client no config.
EAB7D740 [24-12-31 14:15:02.221] I: ssl server no config.
EAB7D740 [24-12-31 14:15:02.306] I: the rtmp server ip: 0.0.0.0, port is: 1935
EAB7D740 [24-12-31 14:15:04.101] I: the http server ip: 0.0.0.0, port is: 8080
generating new self-signed cert for smart_rtmpd@qiyicc.com
EAB7D740 [24-12-31 14:15:04.125] I: rtc-manager build self-signed certificate.
EAB7D740 [24-12-31 14:15:04.125] I: the rtsp server ip: 0.0.0.0, port is: 8554
EAB7D740 [24-12-31 14:15:04.345] I: the srt server ip: 0.0.0.0, port is: 9000
EAB7D740 [24-12-31 14:15:04.346] I: srt bind socket failed(Connection setup failure: unable to create/configure SRT socket) // 端口被别的程序占用了
EAB7D740 [24-12-31 14:15:04.346] I: srt bind socket failed.
EAB7D740 [24-12-31 14:15:04.449] I: the rtmp server stop
EAB7D740 [24-12-31 14:15:04.597] I: the http server stop
EAB7D740 [24-12-31 14:15:04.597] I: the rtsp server stop 正常运行日志打印
[root@localhost bin]# ./smart_rtmpd
48AEE740 [24-12-31 13:40:10.361] I: smart_rtmpd --- build time : 2024-08-15 04:06:58
48AEE740 [24-12-31 13:40:10.361] I: website url : http://www.qiyicc.com/download/rtmpd.zip
48AEE740 [24-12-31 13:40:10.361] I: gitee url : https://gitee.com/mirrors/smart-rtmpd
48AEE740 [24-12-31 13:40:10.361] I: github url : https://github.com/superconvert/smart_rtmpd
48AEE740 [24-12-31 13:40:10.361] I: liveshow url : https://github.com/superconvert/smart_rtmpd/blob/master/liveshow.md
48AEE740 [24-12-31 13:40:10.361] I: development url : https://github.com/superconvert/smart_rtmpd/blob/master/web_dev.md
48AEE740 [24-12-31 13:40:10.361] I: examples url : https://github.com/superconvert/smart_rtmpd/tree/master/example
48AEE740 [24-12-31 13:40:10.361] I: email : cwf12345@sina.com
48AEE740 [24-12-31 13:40:10.361] I: webchat : 99766553, qq : 99766553
48AEE740 [24-12-31 13:40:10.361] I: 192.168.1.102 ens33 // 我们的服务器地址
48AEE740 [24-12-31 13:40:10.404] I: ssl client no config.
48AEE740 [24-12-31 13:40:10.404] I: ssl server no config.
48AEE740 [24-12-31 13:40:10.528] I: the rtmp server ip: 0.0.0.0, port is: 1935
48AEE740 [24-12-31 13:40:11.097] I: the http server ip: 0.0.0.0, port is: 8080
generating new self-signed cert for smart_rtmpd@qiyicc.com
48AEE740 [24-12-31 13:40:11.366] I: rtc-manager build self-signed certificate.
48AEE740 [24-12-31 13:40:11.594] I: the rtsp server ip: 0.0.0.0, port is: 8554
48AEE740 [24-12-31 13:40:11.972] I: the srt server ip: 0.0.0.0, port is: 9000
48AEE740 [24-12-31 13:40:12.004] I: the sip server ip: 0.0.0.0, port is: 5060
48AEE740 [24-12-31 13:40:12.244] I: the ims server ip: 0.0.0.0, port is: 6666
这样 smart_rtmpd 就表示正确运行起来了!!!
推流拉流的验证
推流例子
RTMP 推流ffmpeg -re -stream_loop -1 -i 33.mp4 -vcodec libx264 -acodec aac -f flv rtmp://192.168.1.102:1935/rec/stream
RTMP 推流 ( HEVC )
ffmpeg -re -i 1.mp4 -c:a copy -c:v libx265 -f flv rtmp://192.168.1.102:1935/live/hevc
怎么让 ffmpeg 支持 hevc 推流 怎么编译 ffmpeg 让其支持 hevc(h265) - superconvert的个人空间 - OSCHINA - 中文开源技术交流社区
RTSP 推流
ffmpeg -re -stream_loop -1 -i 1.mp4 -vcodec libx264 -acodec aac -f rtsp rtsp://192.168.1.102:8554/live/stream
RTSP 推流 ( HEVC )
ffmpeg -re -stream_loop -1 -i video-h265.mkv -vcodec libx265 -acodec aac -f rtsp rtsp://192.168.1.102:8554/live/stream
SRT 推流
ffmpeg -re -i 22.mp4 -vcodec libx264 -acodec aac -f mpegts srt://192.168.1.102:9000?streamid=192.168.1.102:9000/live/stream,role=publisher
SRT 推流 ( HEVC )
ffmpeg -stream_loop -1 -re -i video-h265.mkv -vcodec libx265 -acodec aac -f mpegts srt://192.168.1.102:9000?streamid=192.168.1.102:9000/live/stream,role=publisher
拉流例子
RTMP 拉流ffplay rtmp://192.168.1.102:1935/live/stream
HTTP-HLS 拉流
ffplay http://192.168.1.102:8080/live/stream.m3u8
HTTP-DASH 拉流
ffplay http://192.168.1.102:8080/live/stream.mpd
RTSP 拉流
ffplay rtsp://192.168.1.102:8554/live/stream
SRT 拉流 ( ffplay )
ffplay srt://192.168.1.102:9000?streamid=192.168.1.102:9000/live/stream,role=player
更多的推拉流例子请参阅博客 https://blog.csdn.net/freeabc/article/details/117403471?spm=1001.2014.3001.5501
对于支持 Enhanced-rtmp 的 HEVC 推流,需要使用 smart_rtmpd 的收费版本,目前 ffmpeg 从版本 6.1 开始就支持 Enhanced-rtmp 的 HEVC 推流和拉流!!!
- smart_rtmpd 的日志查看
[root@localhost smart_rtmpd]# ./smart_rtmpd
4F136740 [24-12-31 13:58:36.864] I: smart_rtmpd --- build time : 2024-08-15 04:06:58
4F136740 [24-12-31 13:58:36.864] I: website url : http://www.qiyicc.com/download/rtmpd.zip
4F136740 [24-12-31 13:58:36.864] I: gitee url : https://gitee.com/mirrors/smart-rtmpd
4F136740 [24-12-31 13:58:36.864] I: github url : https://github.com/superconvert/smart_rtmpd
4F136740 [24-12-31 13:58:36.864] I: liveshow url : https://github.com/superconvert/smart_rtmpd/blob/master/liveshow.md
4F136740 [24-12-31 13:58:36.864] I: development url : https://github.com/superconvert/smart_rtmpd/blob/master/web_dev.md
4F136740 [24-12-31 13:58:36.864] I: examples url : https://github.com/superconvert/smart_rtmpd/tree/master/example
4F136740 [24-12-31 13:58:36.864] I: email : cwf12345@sina.com
4F136740 [24-12-31 13:58:36.864] I: webchat : 99766553, qq : 99766553
4F136740 [24-12-31 13:58:36.864] I: 192.168.161.136 ens33
4F136740 [24-12-31 13:58:36.892] I: ssl client no config.
4F136740 [24-12-31 13:58:36.893] I: ssl server no config.
4F136740 [24-12-31 13:58:37.027] I: the rtmp server ip: 0.0.0.0, port is: 1935
4F136740 [24-12-31 13:58:37.589] I: the http server ip: 0.0.0.0, port is: 8080
generating new self-signed cert for smart_rtmpd@qiyicc.com
4F136740 [24-12-31 13:58:37.601] I: rtc-manager build self-signed certificate.
4F136740 [24-12-31 13:58:37.601] I: the rtsp server ip: 0.0.0.0, port is: 8554
4F136740 [24-12-31 13:58:37.852] I: the srt server ip: 0.0.0.0, port is: 9000
4F136740 [24-12-31 13:58:37.882] I: the sip server ip: 0.0.0.0, port is: 5060
4F136740 [24-12-31 13:58:38.169] I: the ims server ip: 0.0.0.0, port is: 6666
1FFFF700 [24-12-31 13:59:34.490] I: rtmp-none(obj: 0x7f8534000900, ip: 192.168.161.1:60252) set in_chunk_size to 60000
1FFFF700 [24-12-31 13:59:34.491] I: rtmp-publisher(obj: 0x7f8534000900, ip: 192.168.161.1:60252) stream connected.
1FFFF700 [24-12-31 13:59:34.491] I: rtmp-manager add application(obj: 0x7f8518001e40, url: rtmp://192.168.161.136/live/stream)!
1FFFF700 [24-12-31 13:59:34.507] I: rtmp-app(obj:0x7f8518001e40, url: rtmp://192.168.161.136/live/stream) add http-hls(0x7f8518004de0)
1FFFF700 [24-12-31 13:59:34.507] I: rtmp-app(obj:0x7f8518001e40, url: rtmp://192.168.161.136/live/stream) add http-dash(0x7f8518005f30)
1FFFF700 [24-12-31 13:59:34.507] I: rtsp-manager add application(obj: 0x7f851800bd60, url: rtsp://192.168.161.136:8554/live/stream)!
1FFFF700 [24-12-31 13:59:34.507] I: rtsp-manager add publisher(obj: 0x7f851800b480, url: rtsp://192.168.161.136:8554/live/stream)!
1FFFF700 [24-12-31 13:59:34.507] I: rtmp-app(obj:0x7f8518001e40, url: rtmp://192.168.161.136/live/stream) add rtsp(0x7f851800b480)
1FFFF700 [24-12-31 13:59:34.507] I: srt-manager add application(obj: 0x7f851800f950, url: srt://192.168.161.136:9000/live/stream)!
1FFFF700 [24-12-31 13:59:34.507] I: srt-manager add publisher(obj: 0x7f851800e610, url: srt://192.168.161.136:9000/live/stream)!
1FFFF700 [24-12-31 13:59:34.507] I: rtmp-app(obj:0x7f8518001e40, url: rtmp://192.168.161.136/live/stream) add srt(0x7f851800e610)
1FFFF700 [24-12-31 13:59:34.507] I: rtmp-manager add publisher(obj: 0x7f8534000900, url: rtmp://192.168.161.136/live/stream)!
1FFFF700 [24-12-31 13:59:34.507] I: rtmp-publisher(obj: 0x7f8534000900, ip: 192.168.161.1:60252) build elapse 142 ms.
1FFFF700 [24-12-31 13:59:34.507] I: rtmp-publisher(obj: 0x7f8534000900, ip: 192.168.161.1:60252) amf_cmd unsupport _checkbw
1FFFF700 [24-12-31 13:59:34.548] I: rtmp-publisher(obj: 0x7f8534000900, ip: 192.168.161.1:60252) publish stream
4D4F8700 [24-12-31 13:59:34.616] I: rtmp-app(obj:0x7f8518001e40, url: rtmp://192.168.161.136/live/stream) inital video(h264 size:1000x562 fps:15)
4D4F8700 [24-12-31 13:59:34.673] I: rtmp-app(obj:0x7f8518001e40, url: rtmp://192.168.161.136/live/stream) inital audio(aac sample:44100 channel:2 bit:16) // 推流成功
3D7FA700 [24-12-31 13:59:51.374] I: rtmp-none(obj: 0x7f85340211d0, ip: 192.168.161.1:60259) amf_cmd unsupport _checkbw
3D7FA700 [24-12-31 13:59:51.414] I: rtmp-manager add player(obj: 0x7f85340211d0, url: rtmp://192.168.161.136/live/stream)!
3D7FA700 [24-12-31 13:59:51.414] I: rtmp-player(obj: 0x7f85340211d0, ip: 192.168.161.1:60259) build elapse 84 ms
3D7FA700 [24-12-31 13:59:51.414] I: rtmp-player(obj: 0x7f85340211d0, ip: 192.168.161.1:60259) play stream
4D4F8700 [24-12-31 13:59:52.158] I: rtmp-player(obj: 0x7f85340211d0, ip: 192.168.161.1:60259) inital video meta(sps) // 拉流成功
收尾工作
通过上述工作,我们的 smart_rtmpd 流媒体服务器能正常工作了,让我们来真正运行它吧,是不是操作特别简单,下载,解压,运行即可!
[root@localhost smart_rtmpd]# ./smart_rtmpd -d // 参数 -d 表示以后台模式运行
[root@localhost smart_rtmpd]# tail -f log/20241231.log // 可以查看日志
Good luck!
怎么在 Linux 下运行 smart_rtmpd的更多相关文章
- Linux下运行memcached失败
Linux下运行memcached失败 1.错误信息如下 [root@localhost ~]# memcached can't run as root without the -u switch 2 ...
- Java项目打包在CMD或者Linux下运行
Java项目打包在CMD或者Linux下运行 1.在CMD下运行 在eclipse中将项目export成jar包,然后用压缩软件解压
- Demo+在Linux下运行(CentOS7+dotnetcore sdk)
来份ASP.NET Core尝尝 0x01.前言 学习ASP.NET Core也有一段时间了,虽说很多内容知识点还是处于一知半解的状态,但是基本的,还是 略懂一二.如果有错误,还望见谅. 本文还是和之 ...
- Linux下运行jmeter
• 我们在做测试的时候,有时候要运行很久,公司用的测试服务器一般都是linux,就可以运行在linux下面,linux下面不能像windows一样有图形化界面,那怎么运行脚本呢,就先在windows上 ...
- windows下的java项目打jar分别编写在windows与linux下运行的脚本( 本人亲测可用!)
前言: 最近公司做了一个工具,要将这个工具打包成一个可运行的程序,编写start.bat和start.sh在windows和linux下都可以运行. 在网上找了很多资料,最后终于找到一个可靠的资料,记 ...
- 终于解决了Linux下运行OCCI程序一直报Error while trying to retrieve text for error ORA-01804错误
终于解决了Linux下运行OCCI程序一直报Error while trying to retrieve text for error ORA-01804错误 http://blog.csdn.net ...
- Kali Linux下运行Sniffjoke出错的解决
Kali Linux下运行Sniffjoke出错的解决 由于Kali Linux版本的更新和Sniffjoke发布时间久远等问题,Sniffjoke在新版本的Kali Linux中运行存在各种问题.下 ...
- Linux下运行scala语言的jar包
1.新建project 2.打包 3.linux下运行jar包 #First.jar为jar包名,Test为主类名 [root@FI-2 Desktop]# spark-submit First.ja ...
- jmeter压测、操作数据库、分布式、 linux下运行的简单介绍
一.jmeter压测 1.如何压测 常规性能压测:10-15分钟 稳定性测试:一周.2天等 如果想要压测10分钟,勾选永远,勾选调度器,填写600秒.也可以使用固定启动时间. 2.tps.响应时间 ( ...
- windows下和linux下运行jar
需要在windows下运行jar,首先需要我们打包出来可执行jar idea打包可执行jar可以参考我的另一篇博客[https://mp.csdn.net/postedit/88653200] 一.w ...
随机推荐
- CSS动画(毛玻璃按钮)
1.整体效果 https://mmbiz.qpic.cn/sz_mmbiz_gif/EGZdlrTDJa4ofJ9W4ibgD5asQcBesp1f1CXVnrQmicnzqDPskBNEQC4ia0 ...
- 使用wxpython开发跨平台桌面应用,对常用消息对话框的封装处理
在很多程序中,封装常用消息对话框有很多好处,尤其是在 GUI 应用程序中,本篇随笔结合.net 开发Winform界面的经验,对使用wxpython开发中 wx.MessageDialog 和 wx. ...
- 开源的 API 学习平台「GitHub 热点速览」
前有 5 万颗星标的开源项目 HTTPie 因误操作导致 Star 清零(2022 年),上周知名开源项目 Elasticsearch 也经历了 Star 一夜清零的事件.这些事故的原因均是管理员误将 ...
- win10本地客户端配置SSL并使用MQTTX
1. 本地下载Openssl(默认安装即可,最后一个将打赏取消勾选) Win32/Win64 OpenSSL Installer for Windows - Shining Light Pro ...
- 第二篇:低功耗模组Air724UG硬件设计手册
接着上篇,继续分享. 3.5 串口 模块提供了五个通用异步收发器:主串口 UART1.校准串口 UART2.通用串口 UART3.调试串口 HOST UART 和 ZSP UART. 3.5.1 ...
- 基于木舟平台浅谈surging 的热点KEY的解决方法
一.概述 上篇文章介绍了基于surging的木舟平台如何构建起微服务,那么此篇文章将介绍基于木舟平台浅谈surging 的热点KEY的解决方法 木舟 (Kayak) 是什么? 木舟(Kayak)是基于 ...
- Kafka之使用
windows下的管理工具: kafka-tool: https://www.kafkatool.com/download.html [Windows] 常用命令: # 查看topic 列表 ./b ...
- php-fpm常见错误
1. WARNING: Nothing matches the include pattern '/usr/local/php7/etc/php-fpm.d/*.conf' # cd /usr/loc ...
- 关于PageHiOffice插件在win10登录桌面前提示的解决
win10笔记本开机,在未登录桌面时,总是有PageHiOffice插件已过期的提示. 使用process monitor 的Enable Boot Logging功能进行监视,重启后,再次打开pro ...
- The 2018 ACM-ICPC Asia Qingdao Regional Contest, Online (The 2nd Universal Cup
The 2018 ACM-ICPC Asia Qingdao Regional Contest, Online (The 2nd Universal Cup. Stage 1: Qingdao) J ...