Ask Your Question
0

image shift

asked 2016-04-08 14:19:31 -0600

cocs78 gravatar image

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 :

image description

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 !

edit retag flag offensive close merge delete

Comments

1

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.

Tetragramm gravatar imageTetragramm ( 2016-04-08 15:45:59 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-04-09 03:54:55 -0600

cocs78 gravatar image

Ok thx, it's ok now. I tried with a different FOURCC like you said it and it's works :). This is really strange because the video could be played normally with a video player :s

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-04-08 14:19:31 -0600

Seen: 244 times

Last updated: Apr 08 '16