I’m trying to write a video using opencv’s VideoWriter. Here’s code:
int main() {
//read image from file:
Mat image(cvLoadImage("temp.bmp"));
//create videowriter (DivX codec):
VideoWriter record("output.avi", CV_FOURCC('D','I','V','X'), 30, image.size(), true);
for (int i=0; i<100; ++i) {
//write frame to video:
record<<image;
}
}
This is image (temp.bmp), that I’m trying to write:

(I can upload original bmp file but even with this png result is the same – see below).
But when I open video (output.avi), I see this:

Why video is so shifted?
I have tried different codecs and convert image to different types using cvtColor (CV_BGR2xxx) but with no luck.
Is it time to report a bug?
I’ve just tested this issue on OpenCV 2.4.1 (previously I tested it on version 2.3.1) and it works fine! It seems that it was a bug.