Read and Write OpenCV Videos on Android

1,950 views
Skip to first unread message

@BonozoApps

unread,
May 22, 2012, 2:49:23 PM5/22/12
to android...@googlegroups.com
Dear OpenCVers,

I realize this is most likely a common and old topic, yet I am still confused.  With the latest version of OpenCV (2.4), can VideoCapture feed and write videos?

- Whether videos can be read in or written out, or they have to be single frames, does anyone have some basic sample routine in Java to get me started?  It would truly be appreciated, I am new to OpenCV and Android, but have a console video game development background.  I prefer to use OpenCV in Java when possible.

Thank you very much for your time and insights.

Rui Marques

unread,
May 22, 2012, 7:05:06 PM5/22/12
to
I have never tried to write videos like you ask. A good start would be to read this official android camera tutorial:

To process single frames, that's basically what is done in the opencv android samples. To save a single frame you can use  Highgui.imwrite(Mat, "/mnt/sdcard/image.jpg");

Andrey Pavlenko

unread,
May 23, 2012, 4:06:48 AM5/23/12
to android...@googlegroups.com
OpenCV is a native library with just thin wrappers to Java on Android.
Currently Android doesn't provide native API for video encoding/decoding (OpenMAX is expected to solve this in some time).
A sample code for working with single images/frames can be found in the samples provided with the OpenCV binary package for Android.
Reply all
Reply to author
Forward
0 new messages