Ask Your Question
0

can some one help me understand this error???

asked 2017-04-25 08:07:14 -0500

DrMessina gravatar image

updated 2017-04-25 08:07:51 -0500

[mjpeg @ 000000000058f1c0] error y=33 x=27 [mpjpeg @ 0000000000578420] Expected boundary '--' not found, instead found a line of 29 bytes [mpjpeg @ 0000000000578420] Expected boundary '--' not found, instead found a line of 55 bytes [mpjpeg @ 0000000000578420] Expected boundary '--' not found, instead found a line of 32 bytes

ifact i'm trying to save an image taken from ip camera with java. i just wanted to notice that i never had this error from internal computer camera and i used the same code.... this is my fonction:

@FXML protected void takeAPic(){

    Mat takeAPic= new Mat();
    capture.read(takeAPic);
    Image img=mat2Image(takeAPic);

    BufferedImage image;
    image = SwingFXUtils.fromFXImage(img, null);

    saveImage(image);
}

public boolean saveImage (BufferedImage img) {

   if(img!=null){
    try {
        File outputfile = new File(val+"Saves.png");
        ImageIO.write(img, "jpg", outputfile);
        val++;
    } catch (Exception e) {
        System.out.println("error");
        logger.info(e.getMessage());
    }
    return true;
   }else{ return false;}
}
edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-04-25 08:18:20 -0500

berak gravatar image

updated 2017-04-25 11:32:51 -0500

it's probably far easier, to save your image from opencv:

 Mat takeAPic= new Mat();
 capture.read(takeAPic);
 if ( ! takeAPic.empty() ) // ipcam problem
     Imagecodecs.imwrite("my.png", takeAPic);

(but the error is related to your ipcam/server, it does not conform too the mjpeg protocol)

edit flag offensive delete link more

Comments

thank you!!

DrMessina gravatar imageDrMessina ( 2017-04-26 01:28:47 -0500 )edit

i try your way to do it but i got the same result !! i didn't get this error by initializing a new capture from where i read to take picture and it works well.

DrMessina gravatar imageDrMessina ( 2017-04-26 04:08:42 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-04-25 08:07:14 -0500

Seen: 594 times

Last updated: Apr 25 '17