image shift
Hi
I recorded some videos (BGR type and avi file) with a camera and when I try to open this file and read it I have a big shift :
i record my video with VideoWriter like this :
outputColorVideo.open(videoPath, CV_FOURCC('I', '4', '2', '0'), 30, Size(640, 480), true); ... //Adding some frames ... outputColorVideo.release();
and I read it with VideoCapture like this :
VideoCapture video(videoPath);
if(video.isOpen()){ video.read(frame); imshow("test", frame); } ...
Furthermore, when i watch my video with a movie player like VLC, everything is ok.
Do you know what can explain this problem ?
Thx a lot !
I think you're using the wrong FOURCC. Make sure you're using the same format and size that went into the video. The list of FOURCC codes is here, try the YUV and other 420 codes.