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

Crash mjpeg stream from DLINK 930 L #38

Open
jaumard opened this issue Jun 5, 2017 · 18 comments
Open

Crash mjpeg stream from DLINK 930 L #38

jaumard opened this issue Jun 5, 2017 · 18 comments
Labels

Comments

@jaumard
Copy link

jaumard commented Jun 5, 2017

I tried this library with 3 different stream and camera, works for 2 of them but the third crash :(
It's a D-LINK 930 LB camera, stream works fine from web browser or there Android app but make MjpegSurfaceView crash.

Here is the full log:

MjpegViewDefault: encountered exception during render
                                                                  java.io.IOException: Resetting to invalid mark
                                                                      at java.io.BufferedInputStream.reset(BufferedInputStream.java:437)
                                                                      at java.io.FilterInputStream.reset(FilterInputStream.java:226)
                                                                      at com.github.niqdev.mjpeg.MjpegInputStreamDefault.readMjpegFrame(MjpegInputStreamDefault.java:76)
                                                                      at com.github.niqdev.mjpeg.MjpegViewDefault$MjpegViewThread.run(MjpegViewDefault.java:129)
                                                                  
                                                                  
                                                                  --------- beginning of crash
06-05 18:49:40.539 5917-5970/com.jaumard.lisa E/AndroidRuntime: FATAL EXCEPTION: Thread-5
                                                                Process: com.jaumard.lisa, PID: 5917
                                                                java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
                                                                    at java.util.Properties.loadConvert(Properties.java:569)
                                                                    at java.util.Properties.load0(Properties.java:392)
                                                                    at java.util.Properties.load(Properties.java:342)
                                                                    at com.github.niqdev.mjpeg.MjpegInputStreamDefault.parseContentLength(MjpegInputStreamDefault.java:60)
                                                                    at com.github.niqdev.mjpeg.MjpegInputStreamDefault.readMjpegFrame(MjpegInputStreamDefault.java:72)
                                                                    at com.github.niqdev.mjpeg.MjpegViewDefault$MjpegViewThread.run(MjpegViewDefault.java:129)

Any idea ?

@jaumard
Copy link
Author

jaumard commented Jun 5, 2017

should be nice to at least catch this exception and show a "no compatible stream" or something

@niqdev
Copy link
Owner

niqdev commented Jun 6, 2017

Hi, is the camera public? there is any way I can reproduce the error? Thanks

@jaumard
Copy link
Author

jaumard commented Jun 7, 2017

It's not public but I can open it for some time in order to be able to reproduce the crash. Can I have your email to send you the stream link ? To reproduce it's simple just try to read the stream, for me it crash directly without showing any images

@zxc2694
Copy link

zxc2694 commented Jun 7, 2017

I also met this problem during using a D-LINK DCS-5020L camera. So sad.

@zxc2694
Copy link

zxc2694 commented Jun 7, 2017

@jaumard Could you please share which ipcam can be used fine?

@jaumard
Copy link
Author

jaumard commented Jun 7, 2017

I test with a PS3 eye on a raspberry pi and a raspberry pi with the official cam module (with mjpg_streamer). I don't have ipcam except the D-LINK.

@niqdev
Copy link
Owner

niqdev commented Jun 7, 2017

Hi, have a look at #35 and #32 and let me know if you have the same error, if it works would be nice to add/wrap another implementation

@jaumard
Copy link
Author

jaumard commented Jun 8, 2017

I test #32 no error but no stream lol only blank, I try this library with some public mjpeg stream and when it work it take 10 secondes before showing the first frame...
For #35 how can I test this code without building the all library source ? is it possible ?

@niqdev
Copy link
Owner

niqdev commented Jun 8, 2017

Good to know about #32, for #35 I haven't tried the code, but i think the only way for test it would be to download the project, add it to the source, try with the demo app and make a PR if it works.

@vvarock
Copy link

vvarock commented Jun 14, 2017

Ip camera and mobile connect in same network?

@jaumard
Copy link
Author

jaumard commented Jun 14, 2017

Yes they are also try on another network too but same problem

@vvarock
Copy link

vvarock commented Jun 14, 2017

Try on same network but it's showing error

@zxc2694
Copy link

zxc2694 commented Jun 15, 2017

Hi, I can use #32 to show public IPCAMs, except my DLINK camera. I don't know what the problem is.
But I find DLINK camera view can be fine displayed on WebView.
It's another method to show ipcam view.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    String myURL = "http://XXXXXXXXX";
    WebView myBrowser=(WebView)findViewById(R.id.mybrowser);

    WebSettings websettings = myBrowser.getSettings();
    websettings.setSupportZoom(true);
    websettings.setBuiltInZoomControls(true);
    websettings.setJavaScriptEnabled(true);

    myBrowser.setWebViewClient(new WebViewClient());

    myBrowser.loadUrl(myURL);
}

@vvarock
Copy link

vvarock commented Jun 16, 2017

Unfortunately ip cam demo has stopped how to solve this error

@niqdev
Copy link
Owner

niqdev commented Jun 16, 2017

@vvarock your comments are not constructive, unrelated to the issues and not explanatory, you can't spam and add comments everywhere asking for help if you don't explain your problem, provide a sample of the code and a stacktrace

@niqdev
Copy link
Owner

niqdev commented Jun 16, 2017

@zxc2694 Thanks for sharing, is the format of your stream MJPEG? cos this library supports only that format.
I think your solution could be a valid alternative to the unsupported format.
For example in issue #36 there was a similar problem and after spending time debugging the format was mpjpeg which is not supported

@zxc2694
Copy link

zxc2694 commented Jun 19, 2017

Yes, my ipcam is also MJPEG streaming, and I think #36 problem is the same as mine.
I don't know how to fix this incompatible problem from this library, so I use another alternative solution.

@niqdev
Copy link
Owner

niqdev commented Sep 4, 2018

Hi @zxc2694 , since @jcRuan had a similar issue, if you solve it, would you like to share what was your alternative solution? Thanks

@niqdev niqdev added the bug label Sep 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants