title: ffmpeg rtsp_transport to rtmp issues
body: <p>I'm working on a project that requires taking rtsp links from youtube, and using ffmpeg to stream those videos to an rtmp server. My solution works, however it is having some issues.</p>
  
  <p>I'm using these settings:</p>
  
  <pre><code> -max_delay 0 -initial_pause 0 -rtsp_transport udp -i " + inputLink + " -vcodec libx264 -acodec mp3 -ab 48k -bit_rate 450 -r 25 -s 640x480 -f flv "  + stream
  </code></pre>
  
  <p>inputLink is replaced with the rtsp link, and stream is replaced with the rtmp server link</p>
  
  <p>So this works but here are the issues I'm having:</p>
  
  <ul>
  <li>At the beginning of each video,  there is a big lag spike/lots of frames dropped, and then the video resyncs and plays normally</li>
  <li><p>Some videos would crash ffmpeg, with a "Conversion failed" message and many frames dropped during the conversion/stream. </p></li>
  <li><p>At the end of each video it would start lagging/ dropping frame, right near the end of the video, in other words it doesn't end normally, every video ends by lagging out / dropping frames</p></li>
  </ul>
  
  <p>I've been struggling for a long time just to get this working, and now I finally did, I just need to perfect it by taking care of those two issues, if anyone has useful information about the rtsp_transport protocol and how to make it stream with no issues, I would greatly appreciate it. Thanks!</p>