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!
rtsp
is not identified as a protocol in ffmpeg. It's either udp or tcp. Seeff_rtsp_connect()
in libavformat/rtsp.c – Gyan