Importing video using Javacv

Configuration steps for javacv on Eclipse running on windows 7 can be found in the link below.
http://opencvlover.blogspot.in/2012/04/javacv-setup-with-eclipse-on-windows-7.html

In this post we will see how to import video in javacv for processing. Opencv uses CvCapture function for importing video. Javacv uses FrameGrabber class for grabbing video. Framegrabber can be used with 2 methods for importing video OpenCVFrameGrabber and FFMpegFramegrabber.
Following is the code snippet which uses OpenCVFrameGrabber to capture video file "Video.mp4".


If openCVFrameGrabber shows blank output or some error then try using FFMpegGrabber instead.

10 comments:

  1. Great demo! I am wondering if you know how i can add the canvas to a JFrame so that I can have buttons in the same window?

    Thanks
    Curt

    ReplyDelete
    Replies
    1. I have read your blog its very attractive and impressive. I like it your blog.

      Java Training in Chennai Core Java Training in Chennai Core Java Training in Chennai

      Java Online Training Java Online Training JavaEE Training in Chennai Java EE Training in Chennai

      Delete
  2. Hi! I have a question: how do I stop the video from being displayed when a key is pressed?
    Bye!

    ReplyDelete
  3. hey guys i need i little help in hereim beginner i wanna get video as input using javacv in real time let me explain for exemple i wanna use an android mobile device as a camera to send video using wifi or bluetooth then proces the video on lapp using javacv for object detection or face recognition

    ReplyDelete
  4. Where is "FFMpegGrabber" there is no class FFMpegGrabber in opencv? then how can i use it? I got blank canvas.. Kindly help me!!

    ReplyDelete
    Replies
    1. it is javaCV, not openCV

      Delete
    2. In javacv there is "FFmpegFrameGrabber" with lowercase "m" in "mpeg".

      Delete
  5. I am getting an error : Type mismatch Frame to opencv_highgui.IplImage at line 29

    ReplyDelete
    Replies
    1. Same error. Unable to capture frames. Did you fix it?

      Delete
    2. Same error. Type mismatch between Frame and IplImage

      Delete