Alessio Caiazza is sharing code with you

Bitbucket is a code hosting site. Unlimited public and private repositories. Free for small teams.

Don't show this again

nolith / CaptureMJPEG http://capturemjpeg.lilik.it/

CaptureMJPEG, a processing library for Motion JPEG stream. CaptureMJPEG is released under the LGPLv3 license.

Clone this repository (size: 3.3 MB): HTTPS / SSH
hg clone https://bitbucket.org/nolith/capturemjpeg
hg clone ssh://hg@bitbucket.org/nolith/capturemjpeg

Issues

#6 java.lang.ClassCastException: [I

Reported anonymously

I am trying to use this library it.lilik.capturemjpeg but an java error is blocking it java.lang.ClassCastException: [I any one know the reason for this error? please help :)

Status: duplicate Responsible: nobody Type: bug Priority: major
Milestone: none Component: CaptureMJPEG Version: 1.0

Attachments

No attachments added for this issue yet.

Comments and changes

  1. #1 Alessio Caiazza

    written

    • Changed status from new to duplicate.

    This bug is supposed to be fixed in release 1.0.1 by 4675e4dab7c1 .

    Can you provide your scketch code?

    Duplicate of #4.

  2. #2 Anonymous

    written

    Hrm. I've tried this now on various macs - it works on one mbp running 10.5.4, but not on another (year older) one running the same. Doesn't work on an imac running 10.4.11 either. I'm baffled by it working on one mbp but not the other. Any dependencies which I could be missing?

    Just using the basic_usage example sketch.

  3. #3 Alessio Caiazza

    written

    All required jars are stored with the library.

    On 10.4.11 you need java 1.5 ( see http://processing.org/discourse/yabb2/YaBB.pl?num=1114785707 ) (I've never tested Processing > 1 on OSX 1.4.x)

    Some days ago I've tried on OSX 10.5.(latest version) iMac and iBook G4 and it works fine.

    I'll check it newly.

    Please consider checking which version of CaptureMJPEG are you using, because java.lang.ClassCastException should be raised only with Processing >= 1 and CaptureMJPEG = 1.0

    Can you try Public Demo and report java console errors?

    Tnx

  4. #4 Anonymous

    written

    Thanks for your help (and the library). Working on OSX 10.5, processing 1.0.4 (tried on 1.0.1 too), CaptureMJPEG 1.0.1:

    public demo throws: Disabling captureEvent() for panel0 because of an error. java.lang.ClassCastException: [I at sun.awt.image.ByteInterleavedRaster.getDataElements(ByteInterleavedRaster.java:351) at processing.core.PImage.<init>(PImage.java:182) at it.lilik.capturemjpeg.CaptureMJPEG.run(CaptureMJPEG.java:317)

  5. #5 Alessio Caiazza

    written

    Tested on OS X 10.5.7, runs fine.

    Looking at stack trace you provided:

    public demo throws: Disabling captureEvent() for panel0 because of an error. java.lang.ClassCastException: [I 
       at sun.awt.image.ByteInterleavedRaster.getDataElements(ByteInterleavedRaster.java:351) 
       at processing.core.PImage.<init>(PImage.java:182)
       at it.lilik.capturemjpeg.CaptureMJPEG.run(CaptureMJPEG.java:317)
    

    This makes no sense in CaptureMJPEG 1.0.1 'cause there's any invocation of new PImage( some_stuff ) on line 317, the only invocation of new PImage is in CaptureMJPEG.getPImage(ByteArrayInputStream bais)

    Look changes from 1.0 to 1.0.1 , on 1.0 new PImage was on line 317.

  6. #6 Anonymous

    written

    thanks for your help ! could it be my java, today when I started working on it again I got this message java.lang.NullPointerException what do you think about it?

  7. #7 Alessio Caiazza

    written

    I think we should move the discussion on Processing Forum in order to benefits others contibution.

    If you give me more info I can try to help you, so is a bit vague.

  8. #8 Anonymous

    written

    Hi, thank you very much for your concern!! and the great library !!! I found out what was wrong... I had a old version of java on my computer the 1.5.0_13, I have updated it and everything works perfect !!!!

Add comment / attachment

Verification: Please write the text from the image in the box (letters only)

captcha

Is that you, Humanoid? Is this me?