ipcam-view icon indicating copy to clipboard operation
ipcam-view copied to clipboard

Crash mjpeg stream from DLINK 930 L

Open jaumard opened this issue 8 years ago • 18 comments

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 avatar Jun 05 '17 16:06 jaumard

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

jaumard avatar Jun 05 '17 16:06 jaumard

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

niqdev avatar Jun 06 '17 20:06 niqdev

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

jaumard avatar Jun 07 '17 06:06 jaumard

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

zxc2694 avatar Jun 07 '17 08:06 zxc2694

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

zxc2694 avatar Jun 07 '17 09:06 zxc2694

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.

jaumard avatar Jun 07 '17 09:06 jaumard

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

niqdev avatar Jun 07 '17 19:06 niqdev

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 ?

jaumard avatar Jun 08 '17 08:06 jaumard

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.

niqdev avatar Jun 08 '17 13:06 niqdev

Ip camera and mobile connect in same network?

vvarock avatar Jun 14 '17 09:06 vvarock

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

jaumard avatar Jun 14 '17 11:06 jaumard

Try on same network but it's showing error

vvarock avatar Jun 14 '17 15:06 vvarock

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);
}

zxc2694 avatar Jun 15 '17 06:06 zxc2694

Unfortunately ip cam demo has stopped how to solve this error

vvarock avatar Jun 16 '17 06:06 vvarock

@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 avatar Jun 16 '17 07:06 niqdev

@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

niqdev avatar Jun 16 '17 07:06 niqdev

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.

zxc2694 avatar Jun 19 '17 03:06 zxc2694

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

niqdev avatar Sep 04 '18 20:09 niqdev