This action will force synchronization from MisterZhang/EasyMedia, which will overwrite any changes that you have made since you forked the repository, and can not be recovered!!!
Synchronous operation will process in the background and will refresh the page when finishing processing. Please be patient.
Springboot、netty实现的http-flv、websocket-flv流媒体服务(可用于直播点播),支持rtsp、h264、h265等、rtmp等多种源,h5纯js播放(不依赖flash),不需要依赖nginx等第三方,延迟大部分在1-5秒内(已经支持转复用,h264的流自动转封装,超低延迟。PS:当然还有种更低延迟的不用flv方案没时间写了,但是主要是flv比较大众,这个一般也够用了)。
链接:https://pan.baidu.com/s/17Spfa6-_R4bOsie4qcLM4w 提取码:gomv 复制这段内容后打开百度网盘手机App,操作更方便哦--来自百度网盘超级会员V4的分享
PS:项目里已经集成最新版编译好的前端,由于前端只是个demo,这里是没有hls功能的版本,hls前端播放比较简单,我就懒得上传了
流媒体服务会绑定两个端口,分别为 8866(媒体端口)、8888(web端口,后续会做简单的管理页面) 您只需要将 {您的源地址} 替换成您的,然后放播放器里就能看了
http://localhost:8866/live?url={您的源地址}
ws://localhost:8866/live?url={您的源地址}
例如rtsp:
http://localhost:8866/live?url=rtsp://admin:VZCDOY@192.168.2.84:554/Streaming/Channels/102
ws://localhost:8866/live?url=rtsp://admin:VZCDOY@192.168.2.84:554/Streaming/Channels/102
文件(支持格式参照ffmpeg支持的格式):
http://localhost:8866/live?url=d:/flv/testVideo.mp4
ws://localhost:8866/live?url=d:/flv/testVideo.mp4
电脑桌面投影(url改成desktop即可):
http://localhost:8866/live?url=desktop
ws://localhost:8866/live?url=desktop
永久播放还有一种捷径,就是在播放地址后面加上autoClose=false参数,也会加入到json中。
例如:
http://localhost:8866/live?url=rtsp://admin:VZCDOY@192.168.2.84:554/Streaming/Channels/102&&&autoClose=false
ws://localhost:8866/live?url=rtsp://admin:VZCDOY@192.168.2.84:554/Streaming/Channels/102&&&autoClose=false
###
hls播放例子:(注意:hls为http端口8888,并且不支持url后面参数,开启切片后可以播放)
http://localhost:8888/hls?url=rtsp://admin:VZCDOY@192.168.2.84:554/Streaming/Channels/102
参数加在播放地址url最后面,使用 [&&&] 符号
例如:
http://localhost:8866/live?url=rtsp://admin:VZCDOY@192.168.2.84:554/Streaming/Channels/102&&&autoClose=false&&&ffmpeg=true
ws://localhost:8866/live?url=rtsp://admin:VZCDOY@192.168.2.84:554/Streaming/Channels/102&&&autoClose=false&&&ffmpeg=true
###
autoClose=false 设置为永久播放
ffmpeg=true 使用ffmpeg方式,提高兼容稳定性(不支持的流可以试试这个参数)
//hls=true(目前还不支持此参数,只能api或者网页端控制开启)
可以访问 http://localhost:8888
具体功能参照截图
新增流 http://localhost:8888/add?url={您的源地址}&remark={备注}
停止并删除 http://localhost:8888/del?url={您的源地址}
停止flv推流 http://localhost:8888/stop?url={您的源地址}
开启flv推流 http://localhost:8888/start?url={您的源地址}
开启hls切片 http://localhost:8888/startHls?url={您的源地址}
停止hls切片 http://localhost:8888/stopHls?url={您的源地址}
查看保存的流 http://localhost:8888/list
java -jar EasyMedia-0.0.1-SNAPSHOT.jar
还可以这样改端口
java -jar -Dserver.port=页面端口 -Dmediaserver.port=媒体端口 EasyMedia-0.0.1-SNAPSHOT.jar
rtmp://58.200.131.2:1935/livetv/ahtv
现在flash已经被抛弃,h5播放的时代,网上实现大多不是特别完整的(比如拿到一个rtsp或者rtmp,也不知道怎么在h5页面直接播放),当然现在直播点播有很多方式,可以通过nginx带flv模块的当rtmp服务、还有srs等流媒体服务,而这里我们通过javacv来处理,事实上javacv性能足够,底层ffmpeg也是通过c实现,使用java调用c跟使用c++去调用c差不了多少毫秒延迟。java流媒体资料比较少,但从应用层来说,java有着庞大的生态优势,配合netty写出的流媒体性能可想而知,而此源码目前也比较简单,可读性比较强,有能力者完全能自主改成java分布式流媒体。随着人工智能图像识别的发展,从流媒体获取图像数据是必要条件,有bug希望你们也能及时提出。
最后感谢eguid的javacv文档,https://eguid.blog.csdn.net/
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。