0
votes

I have a demo iOS (8.0 min) project which streams a local mp4 to a server using FFMPEG. An RTMP destination works, an RTSP does not.

When attempting to use RTSP I get a 'Protocol not found' error from

ret = avio_open(&oc->pb, filename, AVIO_FLAG_WRITE);

I have tried to rebuild my FFMPEG libraries and ensured I have the necessary protocols included (To my understanding RTSP is a muxer in FFMPEG, hence the muxer enabling)

--enable-muxer=rtsp \
--enable-muxer=rtp \
--enable-protocol=rtp \
--enable-protocol=rtsp \

In the code, I've tried to add the appropriate AVOptions

av_dict_set(&opt, "rtsp_transport", "udp", 0);
av_dict_set(&opt, "announce_port", "1935", 0);
av_dict_set(&opt, "enable-protocol", "rtsp", 0);
av_dict_set(&opt, "protocol_whitelist","file,udp,tcp,rtp,rtsp", 0);
av_dict_set(&opt, "enable-protocol", "rtp", 0);
av_dict_set(&opt, "enable-protocol", "rtsp", 0);
av_dict_set(&opt, "enable-protocol", "udp", 0);
av_dict_set(&opt, "enable-muxer", "rtsp", 0);
av_dict_set(&opt, "enable-muxer", "rtp", 0);

This is called in my open codec calls.

ret = avcodec_open2(c, codec, &opt);

It feels like I'm missing something very basic, any help would be amazing!

1
rtsp is not identified as a protocol in ffmpeg. It's either udp or tcp. See ff_rtsp_connect() in libavformat/rtsp.cGyan
Thanks for the response! So, to my understanding, RTSP is a muxer in ffmpeg, so the 'protocol not found' is pertaining to tcp or udp? Does this mean there is something missing on my FFMPEG library compile, my stream api setup, or something else? I looked at ff_rtsp_connect and I don't know what specifically to look for...John Lanzivision

1 Answers

0
votes

You should open rtp and rtsp demuxer like this,

--enable-demuxer=rtp 
--enable-demuxer=rtsp

Also with udp and rtp protocol

--enable-protocol=udp
--enable-protocol=rtp