Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad Framerate #9

Open
eliteSchwein opened this issue Apr 29, 2021 · 20 comments
Open

Bad Framerate #9

eliteSchwein opened this issue Apr 29, 2021 · 20 comments

Comments

@eliteSchwein
Copy link

Describe the bug
I have only 3 FPS or so

To Reproduce
Open a HD 30fps Stream

Expected behavior
Run at 30fps

Environment

  • Device: MiMix
  • OS: 11
  • MjpegView version 1.0.9

Additional context

Written in Kotlin but the behavior should be the same in Java

val camViewer: MjpegView = root.findViewById(R.id.webcam_stream)
camViewer.mode = MjpegView.MODE_FIT_WIDTH
camViewer.setUrl(printerData.getString("webcamurl"))
camViewer.isRecycleBitmap = true
camViewer.startStream()

@perthcpe23
Copy link
Owner

perthcpe23 commented May 1, 2021

Can you try using this streaming URL https://server.hafka.co/mjpeg and confirm that the issue is still stand?

@eliteSchwein
Copy link
Author

lower res helps a bit, but i have a HD stream or FHD Stream

@perthcpe23
Copy link
Owner

Sorry to ask but is it your internet connection speed? I try mentioned URL above and it works fine, I got 30 fps (judging by eyes).

@eliteSchwein
Copy link
Author

i have 160mbit, the mjpeg is smooth in browser but not app, i tried it with 640*480 aswell...

@perthcpe23
Copy link
Owner

Is your streaming server publicly accessible? I tried mentioned URL and it works fine on my Sony 5 II. There are too many factors to start discuss one-by-one here. I guess it may have something to do with streaming content your server generates which is supported by browser but, not this library (yet).

@eliteSchwein
Copy link
Author

i use a local url, with webview it works fine

@perthcpe23
Copy link
Owner

So, a connection speed is less likely an issue here. Can you run this command for a few seconds and send me dump.bin file? I suspect the issue is with stream content.

curl --output dump.bin "<YOUR-MJPEG-URL>"

@eliteSchwein
Copy link
Author

with https://server.hafka.co/mjpeg/ it runs smooth, but again thats low res

@perthcpe23
Copy link
Owner

I see. Let me try FHD version of https://server.hafka.co/mjpeg/. I have never worked with FHD mjpeg.

@eliteSchwein
Copy link
Author

i use also 25mbit

@perthcpe23
Copy link
Owner

I changed https://server.hafka.co/mjpeg/ to FHD and fps indeed drops. Now that I can reproduce the issue, I will continue investigating the issue.

@eliteSchwein
Copy link
Author

Yeah i can short your search, its drawBitmap... I tried it with opengl because of that but i domt understand how i can use opengl, maybe it helps you?

@perthcpe23
Copy link
Owner

Thanks, wow that is a whole new level of rendering.

@perthcpe23
Copy link
Owner

perthcpe23 commented May 2, 2021

@eliteSchwein
Copy link
Author

On what Bitrate? And also i dont play just a mjpeg file, i have a live stream

@perthcpe23
Copy link
Owner

Yes Bitrate. If you have control over streaming server. I think that is a plausible workaround.

@eliteSchwein
Copy link
Author

Yeah i have the access over the bitrate, but other people that use my app maybe dont know how to change that on their live stream

@perthcpe23
Copy link
Owner

I think the issue is with how I separate each image from stream using only boundary, instead of using content length and boundary together. The more bytes in each image (higher quality) the more number of time to check for boundary and the longer each checking took. I'm going to try using content length see if it help.

@tykling
Copy link

tykling commented May 3, 2022

Hello. Any news on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants