Monibuca / engine

Monibuca 核心引擎,包含流媒体核心转发逻辑,需要配合功能插件一起组合运行
MIT License
939 stars 199 forks source link

rtmp推流有问题 #25

Closed tinyjoy4code closed 2 years ago

tinyjoy4code commented 2 years ago

windows10下: 推流: ffmpeg -i test.mp4 -f flv rtmp://localhost/live/test

image

拉流: ffplay -i rtmp://localhost/live/test

image

拉流订阅后就退出了: image

以为是拉流的问题,后面跟代码发现,是推流不正常!

image

也就是PushByteStream()函数进来后,只做了下判断,啥也没干... 对RTMP协议不是很熟悉,前面对msg包的处理逻辑看的不是很明白,是前面对msg包处理的问题还是其他情况?

langhuihui commented 2 years ago

你用最新的版本试试呢

tinyjoy4code commented 2 years ago

刚刚试了下最新版本,也还是一样的... image

我还试了下官网首页,那个编译好的,也是一样的... image

另外,官网这个新改版,个人觉得好阴间风啊!!!还是原先的比较简洁,看着舒服一些...

langhuihui commented 2 years ago

我看了一下ffmpeg输出的是flv1格式的视频,你可以通过参数来配置输出h264格式就行了

langhuihui commented 2 years ago

-c:v h264 你可以百度一下啊

tinyjoy4code commented 2 years ago

理解有偏差,- - !这样就可以了! ffmpeg -i test.mp4 -c:v libx264 -f flv rtmp://localhost/live/test

感谢 @langhuihui 的回复!

附上ffmpeg官方文档:https://www.ffmpeg.org/ffmpeg.html