0

I am working on app that converts Images into Video. In Java, I think the Class is Videowriter but unfortunately I can't Initialize that class.

VideoWriter video;
video = new VideoWriter("/storage/emulated/0/test.avi", forcc, 20.0, new Size(640, 
480), true);
if (video.isOpened()) {
       Toast.makeText(this, "Yes", Toast.LENGTH_SHORT).show();
} else {
       Toast.makeText(this, "No", Toast.LENGTH_SHORT).show();
}
video.release();

Here video.isOpened() always return false. Can somebody help me?

  • what is the content of your `forcc` variable? To my knowledge, OpenCV on Android only supports `MJPG`, so if you use a different format this might be the issue. – GenError Jun 09 '22 at 09:19
  • Thank you for your reply... Actually i am using MJPG as fourcc variables but still get false value by isOpened() function – hamza janjua Jun 09 '22 at 18:35

0 Answers0