Create VP09 video - writer not open
Hi all,
I need to create video using the VP09 (or VP08) codec, but when I pass this configuration to VideoWriter, it newer open created file.
I tried to change output video format from "avi" to "mp4", but nothing happens. Uncompressed video (fourcc argument replaced by 0) works fine.
I'm using C++ and openCV as a library, running Windows 10 and Visual Studio 2015.
Any idea whot can be wrong?
Thanks
My code:
#include "opencv2\core\cvdef.h"
#include "opencv2\core.hpp"
#include "opencv2\videoio.hpp"
cv::VideoWriter *outputVideo;
cv::Size S = cv::Size(width, height);
int fps = 10;
cv::String name = "C:\\Users\\pavlak\\Desktop\\movie.avi";
outputVideo = new cv::VideoWriter(name, cv::VideoWriter::fourcc('V', 'P', '0', '9'), fps, S, true);
if (outputVideo->isOpened()){
// newer gets there
}
Update:
- ffmpeg added to app run folder (thanks berak) - using opencv_ffmpeg310_64.dll, according to short opencv code tracing loaded correctly, at least icvCreateVideoWriter_FFMPEG_p is not null
- switch to VP8 (listed on FOURCC codec list as VP80)
- tried to use webm, avi, mkv, mp4
But still no success. I 'll be gratefull for any other hints.
I'm limited by codecs because of comercial app and VP's should be usefull for this. For now I'm using the built-in MJPG, which works fine with avi container (just two hard gained hints: it needs 8bit picture and color set to true, otherwise won't work). But I'm still open for solution for VP's.
Its not because the codec is on the fourcc website, that OpenCV or your OS actually supports it. There is only a limited set of codecs that actually work decently in OpenCV, and they have to be combined with the correct container. Some suggestions of codecs that have been proved to work can be found here.
it says here, that matroska (e.g. webm) and mp4 (but not avi) should be supported for vp09, but none of them produces a working result