Multiple VLC screens playing multiple RTSP streams
Unity Version 2019.3.6f1 VLC for Unity Version 0.0.5
Thank you for making VLC available for Unity! I just bought the asset yesterday and it's working great thus far. I only have a few issues I hope you can help me with.
My use case requires multiple RTSP streams playing on multiple VLC screens in Unity. For testing, I'm using two computers.
Computer #1 (closed) is using eight instances of VLC 3.0.8 to stream eight different videos over RTSP. Port numbers are 8554, 8559, 8564, 8569, 8574, 8579, 8584, 8589. Display locally, no active transcoding, H264 + MP3(MP4). All are on loop.
Computer #2 (closed) is a Corsair One Pro (i7-7700K CPU @ 4.20GHZ, 32GB RAM, GTX 1080) running Unity. In Unity, I have eight VLC screens, each connecting to a different RTSP stream.
This is what I've observed:
-
All eight screens connect to their stream some of the time. Mostly just seven screens connect. The last screen may connect, and for some reason it's always the same screen - it may or may not play. Occasionally only two screens don't connect.
-
All eight screens have never played video at the same time. Mostly four to six will play. Zero to three screens may stop playing after 1-3 seconds. Occasionally, I've gotten seven screens to play at the same time.
-
Even though a video stops playing, the audio is still playing!
Notes:
-
I've run it with a code modification where I only update the texture once every 30 "if (updated)" in the Update loop. This seems to help with performance issues.
-
I've run it with a code modification where I only call "_mediaPlayer.GetTexture(out bool update)" once every 30, 60 and 120 passes in the Update loop. This seems to help with performance issues. At 120 it starts to look like stop motion video. I have not run #1 (closed) and #2 (closed) together at the same time.
-
There doesn't seem to be a way to tell if the stream never connects. _mediaPlayer.Media is never equal to null. How do I know that the URL is invalid?
-
How do I know when a stream disconnects so I can try to reconnect?
-
If the video is not playing on the screen (meaning it connected to the stream, but is only showing a single image on the screen as if it were frozen), the isPlaying flag is still set to true. Do you need additional/different flags? isConnected, isAudioPlaying, isVideoPlaying
-
I added a variable in the inspector so I can mute the audio. This is set after _mediaPlayer.Play()
-
When I'm at work, I normally use the Matrox Maevex 6150 video encoders for streaming - https://www.matrox.com/graphics/en/products/video_over_ip/maevex-6100/quad-4k-encoder-appliance/videos/ Since I'm stuck at home I'm using VLC running on my other PC for testing.
-
Ultimately, I need to stream 6-25 streams into Unity depending on the situation. I've run 12 VLC instances playing 12 separate RTSP streams on computer #2 (closed) and it runs just fine. I've also tested 12 HTTPS Live Stream (HLS) in a browser and it also runs just fine. So in theory, I should be able to run 12 RTSP streams in Unity.
To me, using eight or more VLC screens connecting to separate RTSP streams is a great way to test VLC for Unity. If you can address the issues state above, I think everyone who buys the asset will be fully satisfied with their purchase.
Thank you.