LibVLC, Android and a weird video stream
Posted: 14 Nov 2018 16:09
I have a stream that I'm pulling from a security camera and trying to display it on an Android device using Xamarin as a framework (Working cross-platform).
I've run into an issue with one of the cameras, however, and I'm not entirely sure how to display the feed.
The camera is sending down the stream in h264 but VLC Player is not recognizing what demux to use and so it sits trying to load the stream until you tell it to use something along the lines of h26x in which case you get the following response in the log:
And this will display the video feed just fine. Now I'm using LibVLCSharp for the project I'm trying to get working and it's having this issue again. I whipped up a quick console application and I got the black screen until I put in
in which case it worked just fine and happy afterwards, showing me my stream.
Now when I tried to do the same in the Android project I just get a black screen with no video feed. I did try adding
Which will show other feeds just fine but not this one. I am assuming that the Android VLC Library is having the same issue that the VLC Player was having in that it has no idea what format the stream coming down is in and so it can't properly display it but I have no idea where to even start looking to solve that.
I've run into an issue with one of the cameras, however, and I'm not entirely sure how to display the feed.
The camera is sending down the stream in h264 but VLC Player is not recognizing what demux to use and so it sits trying to load the stream until you tell it to use something along the lines of h26x in which case you get the following response in the log:
Code: Select all
main debug: creating demux: access='http' demux='h26x' location='webaddress/video.web?s=0x2cb56d36&camera=1704448&format=5' file='\\webaddress:4502\video.web'
main debug: looking for demux module matching "h26x": 55 candidates
h26x error: this doesn't look like a h264 ES stream, continuing anyway
main debug: looking for packetizer module matching "any": 24 candidates
main debug: using packetizer module "h264"
main debug: using demux module "h26x"
Code: Select all
media.AddOption(":demux=h264");
Now when I tried to do the same in the Android project I just get a black screen with no video feed. I did try adding
Code: Select all
var configuration = new MediaConfiguration();
configuration.EnableHardwareDecoding();
media.AddOption(configuration);