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.
I'm using these settings:
-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
inputLink is replaced with the rtsp link, and stream is replaced with the rtmp server link
So this works but here are the issues I'm having:
- At the beginning of each video, there is a big lag spike/lots of frames dropped, and then the video resyncs and plays normally
Some videos would crash ffmpeg, with a "Conversion failed" message and many frames dropped during the conversion/stream.
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
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!