Reputation: 543
I am using FFmpeg
for stream rtsp
URL in iOS.
I am trying to stream a local url but my app is failed to open url
avformat_open_input
method always return -5
I have played the same url rtsp://172.16.1.226:5544/1
on VLC media player on my iPhone and macbook it works on both.
After few research i have found there is some problem with rtsp_transport
I was using av_dict_set(&serverOpt, "rtsp_transport", "tcp", 0);
for the server configuration while opening url and the result is can not open feed.
When I changed it to av_dict_set(&serverOpt, "rtsp_transport", "udp", 1);
I am able to open url successfully but I continuously getting error rtsp 1 missing packet and so on.
Can anybody help what should be the right configuration while opening a local rtsp url
using ffmpeg
.
Should i need to update av_dict_set(&serverOpt, "rtsp_transport", "udp", 1)
Thanks in advance
Upvotes: 3
Views: 865
Reputation: 4402
Yes you can use UDP means av_dict_set(&serverOpt, "rtsp_transport", "udp", 0)
in your code it will work.
You can also skip this step. I am playing local and remote both RTSP URL and setting nothing.
Direct open the URL using avformat_open_input
without specify the rtsp_transport
.
Upvotes: 3