title: What is the proper syntax to use ffmpeg to stream H.264 using RTSP over an HTTP tunnel?
body: <p>I'm trying to send an H.264 video stream at 10 fps over rtsp over an http tunnel so the video can be accessed remotely through a firewall and ideally, using only a single port for all communications. I can't just use rtsp because it needs one open port on which the stream is requested, which is fine, but it opens two server ports that it chooses randomly for the video stream and they can't be mapped through the router to the world -- a common problem.</p>
  
  <p>I tried VLC but it won't let me control the server ports that it opens. ffmpeg seems to have more capability selecting ports, but I can't get the syntax right. Here's the command I'm using, where my H.264 stream at 10 fps comes from a pipe, /home/vout1, and I tried limiting the server ports in case it won't let me just use one port for everything:</p>
  
  <pre><code>root@Z-1:~# ffmpeg -r 10 -i /home/vout1 -f rtsp -rtsp_transport http -min_port 25000 -max_port 25009 rtsp://localhost:8554
  </code></pre>
  
  <p>Here's the result, where I've placed the errors messages in bold:</p>
  
  <p>ffmpeg version 3.2.4-static <a href="http://johnvansickle.com/ffmpeg/" rel="nofollow noreferrer">http://johnvansickle.com/ffmpeg/</a>  Copyright (c) 2000-2017 the FFmpeg developers   built with gcc 5.4.1 (Debian 5.4.1-5) 20170205   configuration: --enable-gpl
  --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libxvid
    libavutil      55. 34.101 / 55. 34.101 
    libavcodec     57. 64.101 / 57. 64.101 
    libavformat    57. 56.101 / 57. 56.101 
    libavdevice    57.  1.100 / 57.  1.100 
    libavfilter     6. 65.100 /  6. 65.100 
    libswscale      4.  2.100 /  4.  2.100
    libswresample   2.  3.100 /  2.  3.100
    libpostproc    54.  1.100 / 54.  1.100
  Input #0, h264, from '/home/vout1':
    Duration: N/A, bitrate: N/A
      <strong>Stream #0:0: Video: h264 (High), yuv420p(progressive), 960x540, 25 fps, 25 tbr, 1200k tbn, 50 tbc
  [rtsp @ 0x3d68b30] Unsupported lower transport method, only UDP and TCP are supported for output.
  Could not write header for output file #0 (incorrect codec parameters ?): Invalid argumentStream mapping:
    Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native))
      Last message repeated 1 times</strong></p>
  
  <p>ffmpeg sees the stream because it got the resolution right. But it thinks my stream is the default 25 fps, but I specified -r 10 to say the frame rate is only 10 fps. Second, the stream is not being created.</p>
  
  <p>What is the proper command line syntax and how can I make ffmpeg use one port for everything, even if I can only have one stream ?</p>
  
  <p>Thank you in advance for your help.</p>