Skip to content

How to stop FFmpegFrameGrabber when the video is not broadcasting #413

Description

@GoogleCodeExporter
Hello everybody,

I have this code, that's works fine:

public void CapturaFotoAutomatic(final String nombre, final String ip, final 
String descripcion) { 
try {
FrameGrabber grabber = new FFmpegFrameGrabber("rtp://" + ip + ":1234");
IplImage img;
grabber.setTimeout(1000);
grabber.start();
img = grabber.grab();
String imagenAuto = "../camaras/" + nombre + ".png";//Modificación para 
obtener de rtp

try {
byte[] b;
b = mergeImageAndText(img.getBufferedImage(), descripcion);
FileOutputStream fos = new FileOutputStream("../camaras/" + nombre + ".png");
fos.write(b);
fos.close();
} catch (IOException e) {
e.printStackTrace();
}
grabber.stop();

}catch (Exception e) {
e.printStackTrace();
}
}

But when the video is not broadcasting, the program waits in the  
grabber.start() instructuion.

How I can finish or kill this instrucction?

How I can detect that the video is not working?

version: javacv_0.7 under windows and linux.

Thanks,

Original issue reported on code.google.com by javier.d...@gmail.com on 21 Jan 2014 at 12:11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions