【问题标题】:Can't publish stream on Wowza Streaming engine. Server creates and immediately destroy stream无法在 Wowza 流媒体引擎上发布流。服务器创建并立即销毁流
【发布时间】:2017-02-04 21:23:30
【问题描述】:

我在 AWS 上设置了 Wowza 流引擎,应用程序名称为“live”。我已经为 AWS 上的 Wowza 打开了所有必要的端口来接收和重新传输视频流。

我正在从 LAN 中的 NVR 获取流,并使用 FFMPEG 将来自 Ubuntu 机器的视频流发布到 Wowza 服务器。

ffmpeg -v debug -i "rtsp://888888:888888@192.168.1.5:554/cam/realmonitor?channel=1&subtype=1"  -acodec copy -vcodec copy -sn -f flv "rtmp://xx.xx.xx.xx:1935/live/channel1 live=true pubUser=un pubPasswd=pw"

在终端上大约 60 秒后,它给了我以下错误。

Successfully parsed a group of options.
Opening an output file: rtmp://xx.xx.xx.xx:1935/live/channel1 live=true pubUser=un pubPasswd=pw.
Parsing...
Parsed protocol: 0
Parsed host    : xx.xx.xx.xx
Parsed app     : live
RTMP_Connect0, failed to connect socket. 110 (Connection timed out)
rtmp://xx.xx.xx.xx:1935/live/channel1 live=true pubUser=un pubPasswd=pw: Unknown error occurred

所以,我检查了 Wowza 服务器日志是否有任何线索,我发现了这一点。

2016-09-27  08:22:31  UTC   comment server  INFO    200 -   MediaCasterStreamValidator.init[live/_definst_]: Started
2016-09-27  08:22:31  UTC   comment server  INFO    200 -   ModuleCoreSecurity.onAppStart[live/_definst_]: Publish: AllowedEncoders: securityPublishValidEncoders:Wirecast/|FME/|FMLE/|Wowza GoCoder*|Lavf/|UA Teradek/|KulaByte/|VidBlaster/|XSplit/|PESA  
2016-09-27  08:22:31  UTC   comment server  INFO    200 -   ModuleCoreSecurity.onAppStart[live/_definst_]: Publish: block duplicate stream names : false
2016-09-27  08:22:31  UTC   comment server  INFO    200 -   ModuleCoreSecurity.onAppStart[live/_definst_]: Publish: RTMP Authorization: password file:/usr/local/WowzaStreamingEngine/conf/publish.password
2016-09-27  08:22:31  UTC   comment server  INFO    200 -   ModuleCoreSecurity.onAppStart[live/_definst_]: Play: SecureConnection: securityPlayRequireSecureConnection:false
2016-09-27  08:22:31  UTC   comment server  INFO    200 -   ModuleCoreSecurity.onAppStart[live/_definst_]: Play: securitySecureTokenVersion property is missing, using SecureToken Version 1, play security enabled for RTMP only
2016-09-27  08:22:31  UTC   app-start   application INFO    200 _definst_   live/_definst_
2016-09-27  08:22:31  UTC   connect-pending session INFO    100 <incomming IP>  -   _defaultVHost_  live    _definst_   2.975   [any]   1935    rtmp://xx.xx.xx.xx:1935/live    <incomming IP>` rtmp    -   unknown 1873157588  3178    3073    -   -   -   -   -   -   -   -   -   -   -   -   -   rtmp://xx.xx.xx.xx:1935/live    -
2016-09-27  08:22:31  UTC   connect session INFO    200 <incomming IP>  -   _defaultVHost_  live    _definst_   2.975   [any]   1935    rtmp://xx.xx.xx.xx:1935/live    <incomming IP>  rtmp    -   unknown 1873157588  3178    3073    -   -   -   -   -   -   -   -   -   -   -   -   -   rtmp://xx.xx.xx.xx:1935/live    -
2016-09-27  08:22:32  UTC   create  stream  INFO    200 -   -   _defaultVHost_  live    _definst_   0.0 [any]   1935    rtmp://xx.xx.xx.xx:1935/live    <incomming IP>  rtmp    -   unknown 1873157588  3297    3565    1   0   0   0   -   -   -   -   -   -   rtmp://xx.xx.xx.xx:1935/live    rtmp://xx.xx.xx.xx:1935/live    -   rtmp://xx.xx.xx.xx:1935/live    -
2016-09-27  08:22:33  UTC   destroy stream  INFO    200 -   -   _defaultVHost_  live    _definst_   1.644   [any]   1935    rtmp://xx.xx.xx.xx:1935/live    <incomming IP>  rtmp    -   unknown 1873157588  3347    3796    1   0   0   0   -   -   -   -   -   -   rtmp://xx.xx.xx.xx:1935/live    rtmp://xx.xx.xx.xx:1935/live    -   rtmp://xx.xx.xx.xx:1935/live    -
2016-09-27  08:22:33  UTC   disconnect  session INFO    200 1873157588  -   _defaultVHost_  live    _definst_   5.198   [any]   1935    rtmp://xx.xx.xx.xx:1935/live    <incomming IP>  rtmp    -   unknown 1873157588  3347    3796    -   -   -   -   -   -   -   -   -   -   -   -   -   rtmp://xx.xx.xx.xx:1935/live    -
2016-09-27  08:23:34  UTC   app-stop    application INFO    200 _definst_   live/_definst_

所以基本上服务器身份验证是正确的,但服务器启动流并立即停止。

谁能给我一些指针来寻找这个错误?

【问题讨论】:

  • 我不记得这是否适用于 Wowza,但请尝试使用 -f flv rtmp://[username:password@]server[:port][/app][/instance][/playpath]
  • @aergistal,我已经尝试过这种方法,但它返回了 RTMP_0 数据包丢失错误。因此,我更改了命令并为他们提供了pubUser=un pubPasswd=pw

标签: ubuntu ffmpeg stream wowza


【解决方案1】:

您的 ffmpeg 命令似乎没有发送用户代理字符串(访问日志中的 c-user-agent)。这有助于您的 Wowza 服务器识别哪些 RTMP 连接是有效的发布者。

以下行用于识别在您的 Wowza 服务器中配置的有效代理字符串:

2016-09-27  08:22:31  UTC   comment server  INFO    200 -   ModuleCoreSecurity.onAppStart[live/_definst_]: Publish: AllowedEncoders: securityPublishValidEncoders:Wirecast/|FME/|FMLE/|Wowza GoCoder*|Lavf/|UA Teradek/|KulaByte/|VidBlaster/|XSplit/|PESA

但是您的 ffmpeg 命令正在根据日志发送unknown 代理字符串。尝试在 ffmpeg 命令的输出 URL 中使用以下内容:

"rtmp://localhost/live/myStream flashver=FMLE/3.0\20(compatible;\20FMSc/1.0) live=true pubUser=myuser pubPasswd=mypassword"

它应该传递一个与您的 Wowza 服务器的有效编码器之一匹配的代理字符串。

【讨论】:

    猜你喜欢
    • 2014-06-29
    • 2019-03-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-07-15
    • 1970-01-01
    • 2011-12-19
    相关资源
    最近更新 更多