OpenCv 3.20 for Android. Videowriter and 3rd party libs (ffmpeg)

asked 2017-05-12 11:37:39 -0500

jordiCP gravatar image

OpenCv3.20 for Android only allows (for what I have tried and seen in some posts) videowriter to encode .AVI files with fourcc "MJPG" code. Any other options that I have tried result in .isOpened() returning false.

I am confused as I don't know if the official 3.20 version for android is built with 3rd party libs as ffmpeg. I see that there are options in build process to include this and other 3rd party libs.

My question is: Assuming that it is not included in the official release, if I get to rebuild opencv3.2 with ffmpeg, does it mean that videowriter will internally be able to use them? Or it will be just be just an extension of the lib with its own API but not tied internally to OpenCv? Any hint will be welcome since I am quite lost.

I prefer to ask because instead of trying directly because I am not agile in this (building process) and would like to be sure before spending time with trial and errors

edit retag flag offensive close merge delete

Comments

"as I don't know if the official 3.20 version for android is built with 3rd party libs as ffmpeg" -- simply not so, and that's the reason.

out-of-the-box opencv4android only comes with a single MJPG codec built into the videoio module, so by default, that's the only one you can read or write.

berak gravatar imageberak ( 2017-05-12 11:42:05 -0500 )edit

Thanks berak for your answer! Do you know if building with ffmeg support (through cmake compilation switches) will directly make the other codes available for videowriter?

jordiCP gravatar imagejordiCP ( 2017-05-14 11:32:33 -0500 )edit

it probably will, but the question of how to link that to the VideoCapture / VideoWriter is still unsolved.

(also, can't really help here, sorry)

berak gravatar imageberak ( 2017-05-14 11:51:28 -0500 )edit

Thanks a lot for answering. Will test and report back results in case I achieve something useful :)

jordiCP gravatar imagejordiCP ( 2017-05-15 15:49:31 -0500 )edit