import com.googlecode.javacv.*;
import static com.googlecode.javacv.cpp.opencv_core.*;
public class IpCam {
public static void main(String[] args) throws Exception {
FrameGrabber grabber = new FFmpegFrameGrabber("http://192.168.0.20");
grabber.setFormat("mjpeg");
grabber.start();
IplImage frame = grabber.grab();
CanvasFrame canvasFrame = new CanvasFrame("Camera");
canvasFrame.setCanvasSize(frame.width(), frame.height());
while (canvasFrame.isVisible() && (frame = grabber.grab()) != null) {
canvasFrame.showImage(frame);
}
grabber.stop();
canvasFrame.dispose();
System.exit(0);
}
}The error message I get is this:
Exception in thread "main" com.googlecode.javacv.FrameGrabber$Exception: Could not find stream information.
at com.googlecode.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:224)
at ipcam.IpCam.main(IpCam.java:16)
[mjpeg @ 000000000056B500] Could not find codec parameters (Video: mjpeg)
[mjpeg @ 000000000056B500] Estimating duration from bitrate, this may be inaccurate
Java Result: 1
When I change the format from mjpeg to mpeg I get this message:
Exception in thread "main" com.googlecode.javacv.FrameGrabber$Exception: Could not find stream information.
at com.googlecode.javacv.FFmpegFrameGrabber.start(FFmpegFrameGrabber.java:224)
at ipcam.IpCam.main(IpCam.java:16)
Java Result: 1
What is wrong? Any help would be appreciatedThanks!
Hey dikatano how did you find the video address ("rtsp://192.168.0.20:554/play1.sdp") of the camera?
--
--- You received this message because you are subscribed to the Google Groups "javacv" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javacv+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
No session ID specified.
BTW, does it work with ffplay on the command line?
--
---
You received this message because you are subscribed to the Google Groups "javacv" group.
To unsubscribe from this group and stop receiving emails from it, send an email to javacv+un...@googlegroups.com.