vlcrtspvideo-player

I am using mobilevlckit but some rtsp links are not play using that


I am using MobileVLCKit for play rtsp link

Below is my code for play stream

POD : 'MobileVLCKit', '~> 3.3.16.3' and code is below

func startstream(url: String) {
        guard let url = URL(string: url) else { return }
        videoPlayer.drawable = vwPlayer
        videoPlayer.media = VLCMedia(url: url)
        videoPlayer.delegate = self
        videoPlayer.libraryInstance.debugLogging = true
        videoPlayer.media?.addOption("-vv")
        videoPlayer.media?.addOptions([
            "network-caching": 500,
            "sout-rtp-caching": 100,
            "sout-rtp-port-audio": 20000,
            "sout-rtp-port-video": 20002,
            ":rtp-timeout": 10000,
            ":rtsp-tcp": true,
            ":rtsp-frame-buffer-size":1024,
            ":rtsp-caching":500,
            ":live-caching":500,
        ])
        videoPlayer.media?.addOption(":codec=avcodec")
        videoPlayer.media?.addOption(":vcodec=h264")
        videoPlayer.media?.addOption("--file-caching=2000")
        videoPlayer.media?.addOption("clock-jitter=0")
        videoPlayer.media?.addOption("--rtsp-tcp")
        videoPlayer.media?.clearStoredCookies()
        videoPlayer.audio.isMuted = self.isMuted
        videoPlayer.play()
    }

but some links are not playing so can we overcome this issue trying to play rtsp link using mobile vlc kit but its not working on well I have used pod version 3 also but it also don't work well is there any other player which can play rtsp link so let me know in comment


Solution

  • to check if a link is viewable through VLC, you can try downloading the VLC Desktop application to test it out and avoid wasting time.

    I've noticed the highly-rated ijkplayer library, but I haven't tried it myself. I've seen some demos using ijkplayer, but they seem a bit outdated. You might want to give it a try.

    Alternatively, if you already have a solution, feel free to share it with me, as the time of this article is also 9 months later.