TCP connection refused when using ffserver / ffmpeg

36,757

Solution 1

I was having the same issue, here's what worked for me:

in the /etc/ffserver.conf file put:

BindAddress 0.0.0.0

then in the <feed></feed> section add:

ACL allow 127.0.0.1
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255

assuming your network ip is 192.168.x.x

then start your server:

ffserver -d -f /etc/ffserver.conf

Solution 2

Sounds like you are not allowed connect or possibly that the service is not there.

You sure you have

  1. Started ffserver and that it is on 8090?

  2. That you have set

     ACL allow 127.0.0.1
    

or

     ACL allow localhost

in you ffserver configuration file in the clause?

Share:
36,757
Mike
Author by

Mike

Updated on October 20, 2020

Comments

  • Mike
    Mike over 3 years

    I am getting a "TCP connection to localhost:8090 failed: Connection refused" error when trying to use ffserver on Ubuntu 10.04LTS Desktop.

    I am typing:

    ffmpeg -f video4linux2 -s 640x480 -r 30000/1001 -i /dev/video0 -f avi -vcodec mjpeg -r 30000/1001 http://localhost:8090/feed1.ffm

    Here is the full output:

    Input #0, video4linux2, from '/dev/video0':  
    Duration: N/A, start: 1314207657.841770, bitrate: N/A  
       Stream #0.0: Video: mjpeg, yuvj420p, 1280x720 [SAR 96:96 DAR 16:9], -5 kb/s, 30 tbr, 1000k tbn, 30 tbc  
    [tcp @ 0x9e58980] TCP connection to localhost:8090 failed: Connection refused  
    [buffer @ 0x9e58260] w:1280 h:720 pixfmt:yuvj420p tb:1/1000000 sar:96/96 sws_param:  
    Output #0, avi, to 'http://localhost:8090/feed1.ffm':  
      Metadata:  
        ISFT            : Lavf53.8.0  
        Stream #0.0: Video: mjpeg, yuvj420p, 1280x720 [SAR 96:96 DAR 16:9], q=2-31, 200 kb/s, 29.97 tbn, 29.97 tbc  
    Stream mapping:  
      Stream #0.0 -> #0.0`  
    

    ffserver seems to acknowledge the request though:

    Wed Aug 24 13:40:57 2011 127.0.0.1 - - [POST] "/feed1.ffm HTTP/1.1" 200 1356  
    

    Where is the problem? How can I use ffmpeg correctly?

  • trojek
    trojek about 5 years
    BindAddress option is deprecated. Use HTTPBindAddress instead
  • ierdna
    ierdna almost 5 years
    this was 7 years ago, i'm surprised any of this is still valid