Connection to tcp://127.0.0.1:1935 failed: Connection refused

费尽千辛万苦搭建好了 nginx和ffmpeg...结果推流时....报错了。。。

[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

然后我就哭了。。。这是要干啥啊?不知道哪又搞错了。。

只能继续百度了!。。。。

度娘,我来了...

啊哈!发现了这个。听说要修改ffserver.conf这个配置文件 配置线路

先看没改过的

# 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

歪国大神是这样说的:

要把这个添加到配置文件里面去:

ACL allow 127.0.0.1

ACL allow localhost

ACL allow 192.168.0.0 192.168.255.255

那试试咯

改了还是不行!。。还报这个错。。

然后突然就想到了一个问题,是不是nginx配置文件的问题?但是改了好多次nginx.conf这个文件怎么都不行,但是发现了有一个文件叫 nginx.conf.default....

好奇怪的配置文件,打开发现内容长的和nginx.conf里面的内容一样。。

改下试试咯...已经没有办法了

配置rtmp

重新加载配置文件

推流.....

握草!!

好了!!对nginx还是不太熟悉。。。

写下这篇作为备忘,如果能帮上你,那就更好了

你可能感兴趣的:(Connection to tcp://127.0.0.1:1935 failed: Connection refused)