7

VLCMobileKit cannot open RTSP streaming video.

Here is the code:

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    DispatchQueue.main.async {
        // Create `VLCMedia` with the URI retrieved from the camera
        if let _URI = self.URI, let url = URL(string: _URI) {
            let media = VLCMedia(url: url)
            self.mediaPlayer.media = media
            self.mediaPlayer.play()
        }
    }
}

It shows the error:

VLC is unable to open the MRL 'rtsp://193.159.244.134/rtsp_tunnel?profile=0&h26x=4&enableaudio=1&audio_mode=1&vcd=2'

Dhiraj Das
  • 174
  • 9
  • 1
    https://stackoverflow.com/help/mcve – Alejandro Iván May 25 '18 at 14:44
  • Have you tested the camera from VLC on the desktop or the app using the same MRL? – Bryan Scott May 30 '18 at 14:59
  • I have tried the same URL using the sample on this Pod - https://github.com/rvi/ONVIFCamera (which uses VLCMobileKit to play the stream too) When I use the ONVIFCamera Pod and try to use VLCMobileKit to play the video, it just doesnot play – Dhiraj Das May 30 '18 at 15:15

1 Answers1

0

It seems that your URL is "protected"(username & password).

If you try this URL: rtsp://184.72.239.149/vod/mp4:BigBuckBunny_175k.mov, it should work fine.

Perhaps something like this might work(not tested):

rtsp://username:password@url

For example: rtsp://foo:bar@192.168.1.42/catroom

bubu
  • 333
  • 2
  • 9