Ask Your Question
1

VideoCapture can not get the right code of codec

asked 2013-05-07 03:20:42 -0600

kelvin00 gravatar image

updated 2013-05-07 03:56:56 -0600

VideoCapture vido_file("D:\1.avi");

    if(vido_file.isOpened()==NULL)
            return -1;
    int ex = static_cast<int>(vido_file.get(CV_CAP_PROP_FOURCC));

i copy the codes from user manul,but i doesn't work. ex=1196444237,why ? thank you for help .

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2013-05-07 03:42:04 -0600

Basically, use the fourcc codec website to know the correct code for your video. Then use the CV_FOURCC('','','','') functionality to add the correct codec.

In your case, looking at an AVI file format, most likely you will have a mpeg4 or mpeg5 codec.

edit flag offensive delete link more

Comments

but why i can not get the right codec? are there some things wrong with my code? thank you ?

kelvin00 gravatar imagekelvin00 ( 2013-05-07 22:29:46 -0600 )edit

I do not know which integer values are behind all fourcc codes. That is why people just use the CV_FOURCC function, since it internally knows all the codes.

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-08 02:33:52 -0600 )edit

thank you .best wishes!

kelvin00 gravatar imagekelvin00 ( 2013-05-16 02:20:18 -0600 )edit

If it suited your problem, please mark the topic as solved :)

StevenPuttemans gravatar imageStevenPuttemans ( 2013-05-16 02:46:33 -0600 )edit

Question Tools

Stats

Asked: 2013-05-07 03:20:42 -0600

Seen: 645 times

Last updated: May 07 '13