title: Serving rtmp on port 1935
body: <p>I've been trying to get ffmpeg to stream in rtmp but connection to port 1935 is always refused. I really don't know what else I can do to allow this connection. </p>
  
  <p>Here is what specs I'm running. </p>
  
  <ul>
  <li>Ubuntu 18.04 (tried with 19.04) however same issue - here is why I think I've made a mistake</li>
  <li>No Nginx installation at the moment</li>
  <li>FFMPEG "ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)"</li>
  </ul>
  
  <p>This is the script I run: </p>
  
  <pre><code>ffmpeg -i "test.mp4" -c:v copy -c:a copy -f flv "rtmp://127.0.0.1/stream/test"
  </code></pre>
  
  <p>Error I get is:</p>
  
  <pre><code>[tcp @ 0x55ff05ab8ce0] Connection to tcp://127.0.0.1:1935 failed: Connection refused
  </code></pre>
  
  <p>I've done some research and been across many posts about ffserver.conf and I have made those changes but still no luck. Here is my config file. I also have ran ffserver once using this config. </p>
  
  <pre><code>
  
  
  HTTPPort 8090
  HTTPBindAddress 127.0.0.1
  MaxHTTPConnections 2000
  MaxClients 1000
  MaxBandwidth 1000
  CustomLog -
  
  &lt;Feed feed1.ffm&gt;
  
  File /tmp/feed1.ffm
  FileMaxSize 200K
  
  # Only allow connections from localhost to the feed.
  ACL allow 127.0.0.1
  ACL allow localhost     
  ACL allow 192.168.0.0 192.168.255.255
  &lt;/Feed&gt;
  
  &lt;Stream test1.mpg&gt;
  
  # coming from live feed 'feed1'
  Feed feed1.ffm
  
  Format mpeg
  AudioBitRate 32
  
  # Number of audio channels: 1 = mono, 2 = stereo
  AudioChannels 2
  AudioSampleRate 44100
  
  # Bitrate for the video stream
  VideoBitRate 64
  
  # Ratecontrol buffer size
  VideoBufferSize 40
  
  # Number of frames per second
  VideoFrameRate 3
  
  
  &lt;/Stream&gt;
  
  
  &lt;Stream test.asf&gt;
  Feed feed1.ffm
  Format asf
  VideoFrameRate 15
  VideoSize 352x240
  VideoBitRate 256
  VideoBufferSize 40
  VideoGopSize 30
  AudioBitRate 64
  StartSendOnKey
  &lt;/Stream&gt;
  
  # Special streams
  
  # Server status
  
  &lt;Stream stat.html&gt;
  Format status
  
  ACL allow localhost
  ACL allow 127.0.0.1
  ACL allow 192.168.0.0 192.168.255.255
  
  #FaviconURL http://pond1.gladstonefamily.net:8080/favicon.ico
  &lt;/Stream&gt;
  
  &lt;Redirect index.html&gt;
  URL http://www.ffmpeg.org/
  &lt;/Redirect&gt;
  </code></pre>
  
  <p>Here is my ufw status:</p>
  
  <pre><code>--                         ------      ----
  22/tcp                     ALLOW       Anywhere
  22                         ALLOW       Anywhere
  1935/tcp                   ALLOW       Anywhere
  22/tcp (v6)                ALLOW       Anywhere (v6)
  22 (v6)                    ALLOW       Anywhere (v6)
  1935/tcp (v6)              ALLOW       Anywhere (v6)
  </code></pre>
  
  <p>but still nothing, I've also opened ports in iptables but no luck. Here is how this is done: </p>
  
  <pre><code>iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 1935 -j ACCEPT
  
  and
  
  iptables -A OUTPUT -m state --state NEW -m tcp -p tcp --dport 1935 -j ACCEPT
  </code></pre>
  
  <p>and still nothing, every time I run ffmpeg I get connection refused. I have previously installed nginx just to test but no luck. </p>
  
  <p>What am I doing wrong here? Isn't this port suppose to be open now? </p>
  
  <p>Thanks</p>