Hi, I'm using OpenCV with python bindings and I want to use VideoWriter with webm output, I am using VP8 codec. It creates VideoWriter correctly and without an error. It creates output file and it puts information about resolution in it, but when I write image into it, it doesn't do anything and output file is always only 7 KiB. I have also tried it in C++ with the same result.
I am using Fedora 19, 64bit. I have added RPM Fusion repos and tried to install every gstreamer plugin, ffmpeg and everything that popped out when I searched "VP8". I also tried it in Ubuntu 13.04 with the same result. I rather think that this is a bug, because when I tried to use different codec (xvid), it worked. Try it with this C++ code:
#include <iostream>
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main(int, char **) {
VideoCapture capture(0);
Mat frame;
capture >> frame;
cout << frame.size() << endl;
VideoWriter record("out.webm", CV_FOURCC('V', 'P', '8', '0'), 30, frame.size(), true);
namedWindow("video", 1);
for (;;) {
capture >> frame;
imshow("video", frame);
record << frame;
if (waitKey(30) >= 0) break;
}
return 0;
}
or this simple python program:
import cv2
from numpy import *
a = zeros((768, 1024, 3), dtype=uint8)
b = ones((768, 1024, 3), dtype=uint8)
vw = cv2.VideoWriter("out.webm", cv2.cv.CV_FOURCC(*"VP80"), 24, (1024, 768), True)
for i in xrange(256):
vw.write(a)
a = a + b
I am using OpenCV 2.4.5.