Using specific network with libVLC on Android
Posted: 21 Dec 2020 20:08
I'm using libVLC in my Android app to stream video over rtsp from the camera that I'm connected to over WiFi.
In general, streaming works fine, but there seems to be streaming problem if I'm connected do the camera by WiFi (that provides no internet) and also have got mobile data turned on. I use bindProcessToNetwork to make sure that the streaming is done via my WiFi network. On some devices (like Huawei Mate 10 with Android 9) the streaming works ok (it seems to use WiFi and ignore having mobile data on), but on other devices (like Samsung Note 10 with Android 10) when I use new networking API it seems that VLC is trying to connect via the mobile data, and only after some time when it fails it decides to use my camera's WiFi (despite the fact that I used bindProcessToNetwork).
I get an error log
Suprisingly, it works fine if I connect to my WiFi from the system settings...
I found some comments that media streaming is done in a separate process, and it ignores calling to bindProcessToNetwork https://stackoverflow.com/questions/419 ... ediaplayer but on some devices (and Android versions) is seems to work and on others it does not.
Is there a way to force libVLC to stream using a specified network?
In general, streaming works fine, but there seems to be streaming problem if I'm connected do the camera by WiFi (that provides no internet) and also have got mobile data turned on. I use bindProcessToNetwork to make sure that the streaming is done via my WiFi network. On some devices (like Huawei Mate 10 with Android 9) the streaming works ok (it seems to use WiFi and ignore having mobile data on), but on other devices (like Samsung Note 10 with Android 10) when I use new networking API it seems that VLC is trying to connect via the mobile data, and only after some time when it fails it decides to use my camera's WiFi (despite the fact that I used bindProcessToNetwork).
I get an error log
Code: Select all
VLC-std: Unable to determine our source address: This computer has an invalid IP address: 0.0.0.0
I found some comments that media streaming is done in a separate process, and it ignores calling to bindProcessToNetwork https://stackoverflow.com/questions/419 ... ediaplayer but on some devices (and Android versions) is seems to work and on others it does not.
Is there a way to force libVLC to stream using a specified network?