2016-09-27 54 views
0

我已經在AWS上使用應用程序名稱「live」設置了Wowza Streaming Engine。我已經在AWS上爲Wowza開放了所有必要的端口來接收和重新傳輸視頻流。無法在Wowza Streaming引擎上發佈流。服務器創建並立即銷燬流

我從局域網中的NVR獲取流,並使用FFMPEG將來自Ubuntu機器的視頻流用下面的命令發佈到Wowza Server上。

ffmpeg -v debug -i "rtsp://888888:[email protected]: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_ 

所以基本上服務器認證是正確的,但服務器啓動流並立即停止。

任何人都可以請給我一些指針來尋找這個錯誤?

+0

我不記得這是否適用於Wowza,但嘗試使用'-f flv rtmp:// [username:password @] server [:port] [/ app] [/ instance] [/ playpath]'。 – aergistal

+0

@aergistal,我已經嘗試過這種方法,但是那個返回給我的是RTMP_0包丟失錯誤。所以,我改變了命令併爲他們提供了'pubUser = un pubPasswd = pw'。 –

回答

0

看起來您的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命令的輸出網址:

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

它應該通過符合你的Wowza服務器的有效編碼器之一的代理字符串。