title: Make UDP-RTMP bridge with FFMPEG
body: <p>I need to make this chain, using computer 2 as a "bridge" between Computer 1 and the streming server.</p>
  
  <p>Computer 1 ----> Computer 2 ----> Streaming server (Wowza).</p>
  
  <p>So I'm trying to set this:
  Computer 1 --(via UDP)--> Computer 2 --(Via RTMP)--> Wowza</p>
  
  <h1>What I've tried:</h1>
  
  <h2>1. At Computer 1</h2>
  
  <p><strong>Entry:</strong></p>
  
  <pre><code>ffmpeg -i sample.mp4 -c:v copy -c:a copy -f mpegts udp://192.168.0.109:5010
  </code></pre>
  
  <p><strong>Result:</strong> <em>Worked</em>. Computer 1 sends the data correctly. </p>
  
  <h2>2. At Computer 2</h2>
  
  <p><strong>Entry:</strong></p>
  
  <pre><code>ffmpeg -i upd://192.168.0.109:5010 output.mp4
  </code></pre>
  
  <p><strong>Result:</strong> <em>Worked</em>. Computer 2 gets data correctly. Output.mp4 is generated well.</p>
  
  <p><strong>Entry:</strong></p>
  
  <pre><code>ffmpeg -i sample.mp4 -c:v copy -c:a copy -f flv rtmp://wowzaServerAddress
  </code></pre>
  
  <p><strong>Result:</strong> <em>Worked</em>. Wowza shows online the video from sample.mp4</p>
  
  <p><strong>Entry:</strong></p>
  
  <pre><code>ffmpeg -re -i udp://@:5010 -f flv rtmp://wowzaServerAddress
  </code></pre>
  
  <p><strong>Result:</strong></p>
  
  <p><em>stuck at:</em></p>
  
  <pre><code>ffmpeg version N-77234-g906c0b7 Copyright (c) 2000-2015 the FFmpeg
  built with gcc 5.2.0 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
  libavutil 55. 10.100 / 55. 10.100
  libavcodec 57. 17.100 / 57. 17.100
  libavformat 57. 20.100 / 57. 20.100
  libavdevice 57.0.100 / 57. 0.100
  libavfilter 6.21.100 / 6. 21.100
  libswscale 4.0.100 / 4. 0.100
  libswresample 2. 0.101 / 2. 0.101
  libpostproc 54. 0.100 / 54. 0.100
  **Entry:**
      ffmpeg -i udp://192.168.0.109:5010 -c:v copy -c:a copy -f flv rtmp://wowzaServerAddress
  **Result:**
  *... repeated a lot ...*
  Last message repeated 1 times
  [h264 @ 000001cef0462200] decode_slice_header error
  [h264 @ 000001cef0462200] no frame!
  *... repeated a lot ...*
   Input #0, mpegts, from 'udp://192.168.0.109:5010':
   Duration: N/A, start: 128.032333, bitrate: N/A
   Program 1
  Metadata:
  service_name: RARBG.COM - Spotlight.2015.1080p.WEB-DL.DD5.1.H264-RARBG
  service_provider: FFmpeg
  Stream #0:0[0x100]: Video: h264 (Main) ([27][0][0][0] / 0x001B), 
  yuv420p(tv, bt709), 1916x1032 [SAR 1:1 DAR 479:258], 23.98 fps, 23.98 tbr, 90k tbn, 180k tbc
  Stream #0:1[0x101](eng): Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 200 kb/s
  [flv @ 000001cef132a1c0] Codec for stream 0 does not use global headers but container format requires global headers
  [flv @ 000001cef132a1c0] Codec for stream 1 does not use global headers but container format requires global headers
  Output #0, flv, to '**rtmp://wowzaServerAddress**':
  Metadata:
  encoder: Lavf57.20.100
  Stream #0:0: Video: h264 ([7][0][0][0] / 0x0007), yuv420p, 1916x1032 [SAR 
  1:1 DAR 479:258], q=2-31, 23.98 fps, 23.98 tbr, 1k tbn, 90k tbc
  Stream #0:1(eng): Audio: aac ([10][0][0][0] / 0x000A), 48000 Hz, stereo, 
  200 kb/s
  Stream mapping:
  Stream #0:0 - #0:0 (copy)
  Stream #0:1 - #0:1 (copy)
  Press [q] to stop, [?] for help
  [flv @ 000001cef132a1c0] Malformed AAC bitstream detected: use the audio 
  bitstream filter 'aac_adtstoasc' to fix it ('-bsf:a aac_adtstoasc' option with ffmpeg)
  av_interleaved_write_frame(): Invalid data found when processing input
  [flv @ 000001cef132a1c0] Malformed AAC bitstream detected: use the audio bitstream filter 'aac_adtstoasc' to fix it ('-bsf:a aac_adtstoasc' option with ffmpeg)
  [flv @ 000001cef132a1c0] Failed to update header with correct duration.
  [flv @ 000001cef132a1c0] Failed to update header with correct filesize.
  Error writing trailer of rtmp://**wowzaServerAddress**: Invalid data found when processing inputframe= 1 fps=0.0 q=-1.0 Lsize= 0kB time= 00:00:02.13 bitrate= 1.6kbits/s
  video:33kB audio:59kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
  </code></pre>
  
  <p><strong>Conversion failed!</strong></p>