費(fèi)盡千辛萬苦搭建好了 nginx和ffmpeg...結(jié)果推流時....報(bào)錯了状您。枢舶。涂邀。
[tcp @ 0x1826bc0]Connection to tcp://127.0.0.1:1935 failed: Connection refused
[rtmp @ 0x1826680]Cannot open connection tcp://127.0.0.1:1935
rtmp://127.0.0.1:1935/rtmplive/home: Connection refused
然后我就哭了隘击。侍芝。。這是要干啥奥裢州叠?不知道哪又搞錯了。凶赁。
只能繼續(xù)百度了咧栗!。虱肄。致板。。
度娘咏窿,我來了...
啊哈斟或!發(fā)現(xiàn)了這個。聽說要修改ffserver.conf這個配置文件 配置線路
先看沒改過的
<Feed feed1.fm>
# You must use 'ffmpeg' to send a live feed to ffserver. In this
# example, you can type:
#
# ffmpeg http://localhost:8090/feed1.ffm
# ffserver can also do time shifting. It means that it can stream any
# previously recorded live stream. The request should contain:
# "http://xxxx?date=[YYYY-MM-DDT][[HH:]MM:]SS[.m...]".You must specify
# a path where the feed is stored on disk. You also specify the
# maximum size of the feed, where zero means unlimited. Default:
# File=/tmp/feed_name.ffm FileMaxSize=5M
File /tmp/feed1.ffm
FileMaxSize 200K
# You could specify
# ReadOnlyFile /saved/specialvideo.ffm
# This marks the file as readonly and it will not be deleted or updated.
# Specify launch in order to start ffmpeg automatically.
# First ffmpeg must be defined with an appropriate path if needed,
# after that options can follow, but avoid adding the http:// field
#Launch ffmpeg
# Only allow connections from localhost to the feed.
ACL allow 127.0.0.1
</Feed>
歪國大神是這樣說的:
要把這個添加到配置文件里面去:
ACL allow 127.0.0.1
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
那試試咯
改了還是不行集嵌!萝挤。。還報(bào)這個錯根欧。怜珍。
然后突然就想到了一個問題,是不是nginx配置文件的問題凤粗?但是改了好多次nginx.conf這個文件怎么都不行绘面,但是發(fā)現(xiàn)了有一個文件叫 nginx.conf.default....
好奇怪的配置文件,打開發(fā)現(xiàn)內(nèi)容長的和nginx.conf里面的內(nèi)容一樣侈沪。揭璃。
改下試試咯...已經(jīng)沒有辦法了
配置rtmp
重新加載配置文件
推流.....
握草!亭罪!
好了J葩伞!對nginx還是不太熟悉应役。情组。燥筷。
寫下這篇作為備忘,如果能幫上你院崇,那就更好了