-
Notifications
You must be signed in to change notification settings - Fork 162
Open
Description
I have added the code to my project and everything is working fine, except the fps rate.
Although getting the same 3-4FPS on an emulator(video is a bit stable) but on a physical device 3-4fps are too lagy getting 5-7 seconds of delay and the video stuck on camera movement.
I have installed the ipCam app from the play store and creating a local server for stream.
layout XML:
<com.github.niqdev.mjpeg.MjpegSurfaceView
android:id="@+id/mjpegViewDefault"
android:layout_width="match_parent"
android:layout_height="300dp"
stream:type="stream_default" />
Here is how I have added it to my android activity:
private void loadIpCam(String streamIdVal) {
String url = "http://"+streamIdVal+"/video";
textViewUrl.setText("Playing: "+url);
Mjpeg.newInstance()
.credential("", "")
.open(url, TIMEOUT)
.subscribe(
inputStream -> {
mjpegView.setSource(inputStream);
//mjpegView.setResolution(480,360);
mjpegView.setDisplayMode(DisplayMode.BEST_FIT);
mjpegView.showFps(true);
mjpegView.setRotate(90);
},
throwable -> {
Log.e(getClass().getSimpleName(), "mjpeg error", throwable);
Toast.makeText(this, "Error", Toast.LENGTH_LONG).show();
});
}
for network security config I have added these configurations to my application in Android.manifest
<application
...
android:networkSecurityConfig="@xml/network_security_config"
...>
</application>
network_security_config.xm file is:
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true">
<trust-anchors>
<certificates src="system" />
</trust-anchors>
</base-config>
</network-security-config>
Metadata
Metadata
Assignees
Labels
No labels