VLCMobileKit does not play RTSP video
Asked Answered
T

1

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'

Transoceanic answered 16/5, 2018 at 5:49 Comment(3)
stackoverflow.com/help/mcveKnar
Have you tested the camera from VLC on the desktop or the app using the same MRL?Elementary
I have tried the same URL using the sample on this Pod - 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 playTransoceanic
W
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:[email protected]/catroom

Wagers answered 31/5, 2018 at 15:16 Comment(2)
Yes the url is protected and I do supply the username and password but to no availTransoceanic
What version of MobileVLCKit are you using?Wagers

© 2022 - 2024 — McMap. All rights reserved.