I'm trying to display the byte [] array that is taken from the RtspClientSharp.dll into an <img>
tag (HTML), but this only works when the page in loading (ASP.NET). What I´m trying to do is to display every frame as faster as the user can watch the video from an IP camera.
The way I use to set the image URL is
String.Format("data:image/png;base64,{0}", Convert.ToBase64String(viewer.imageBytes))
Here is the code:
@{
ViewData["Title"] = "Home Page";
}
@{
CameraViewer viewer = new CameraViewer("192.168.0.65");
viewer.Start();
}
<div class="veiwer">
@while(!viewer.isDisplayed){}
@{String imgUrl=String.Format("data:image/png;base64,{0}", Convert.ToBase64String(viewer.imageBytes));}
<img src="@imgUrl"/>
</div>
I have tried using JavaScript too, but it doesn't works.