Ovidiu I.
Ovidiu I.

Reputation: 55

FFmpeg - Streaming from a rtsp server to a rtmp server - loosing packages

I'm trying to stream a video from a rtsp server to a rtmp one using FFmpeg. Tried multiple arguments for my command :

ffmpeg.exe -re -i "rtsp://10.65.28.251:11442/video/live" -pix_fmt yuv420p -codec:v libx264 -tune animation -preset fast -crf 23 -maxrate 4M -bufsize 8M -f flv "rtmp://10.65.58.21:1935/rec/XB"

ffmpeg.exe -re -i "rtsp://10.65.28.251:11442/video/live" -preset ultrafast -vcodec libx264 -tune zerolatency -b 900k -f flv "rtmp://10.65.52.131:1935/rec/XB

I'm loosing a lot of packages as seen in the picture. I'm pretty new to FFmpeg so I'm pretty sure I'm messing up the parameters somehow.

My goal is to get a video on rtmp with min 30fps and as least lost packages as possible. If needed a downsize of the video quality would be fine.

Any idea what I'm doing wrong?

Thanks!

enter image description here

Upvotes: 0

Views: 9667

Answers (2)

hasayakey
hasayakey

Reputation: 10919

You are pulling RTSP stream over UDP. try 'ffmpeg -rtsp_flags prefer_tcp -rtsp_transport tcp -i rtsp://some_rtsp_url' to force pull rtsp streams over TCP

Upvotes: 0

Ovidiu I.
Ovidiu I.

Reputation: 55

As kesh pointed above removing -re made a big difference. I ended up with this command which holds pretty good quality at 30fps.

ffmpeg.exe -i "rtsp://serversource:11442" -filter:v fps=fps=30 -crf 40 -preset ultrafast -vcodec libx264 -f flv "rtmp://servertarget:1935"

Upvotes: 3

Related Questions