Play rtsp stream video in android

427documentation shows that androidmedia player support rtsp video Media Framework Technical Reference | Unreal Engine Documentation however, it does not work,
anyone has an idea to make it ? thanks a lot !!!

Looking through the code it looks like RTSP url’s cannot work for 2 reasons:

  • The code checks if the url is valid by using java’s HTTPUrlConnection in the “URL exists” call, the HTTPURLConnection object does not support RTSP stream
  • Furthermore, even if you were to remove that check and recompile the engine, the url is passed to Android’s MediaExtractor. This class does not support RTSP streams.

In conclusion, I don’t believe RTSP is supported through the AndroidMediaPlayer

For details, here are logs from a UE 4.27.2 app running on the Oculus Quest 2 showing the errors.

1-21 15:25:14.630  4970  5004 D UE4     : FAndroidMedia::Open(rtsp://192.168.0.246:8554/mystream.mp4) - 3A3ED8064C019C44C44D21BA22C0CED9
01-21 15:25:14.630  4970  5004 D UE4     : FAndroidMedia::Close() - 3A3ED8064C019C44C44D21BA22C0CED9
01-21 15:25:14.630  4970  5004 W System.err: java.net.MalformedURLException: unknown protocol: rtsp
01-21 15:25:14.631  4970  5004 W System.err:    at java.net.URL.<init>(URL.java:608)
01-21 15:25:14.631  4970  5004 W System.err:    at java.net.URL.<init>(URL.java:498)
01-21 15:25:14.631  4970  5004 W System.err:    at java.net.URL.<init>(URL.java:447)
01-21 15:25:14.631  4970  5004 W System.err:    at com.epicgames.ue4.MediaPlayer14.RemoteFileExists(MediaPlayer14.java:243)
01-21 15:25:14.631  4970  5004 W System.err:    at com.epicgames.ue4.MediaPlayer14.setDataSourceURL(MediaPlayer14.java:289)

I’m using a Quest 2, do you know what can cause the mute stream playback on Android ?

I’m using m3u8 stream format, the video works great in HD, but I get no sound

I only have one m3u8 URL that works with audio+video but it’s not a live stream
Maybe audio codec issue ?

Thank you