简体   繁体   中英

opencv rewrite a compressed video file

Heylo!

I have a video file (unknown compression) of about 500MB in size. I am experimenting with OpenCv and try to discard some frames and resave that file.

When run the program for ~3 minutes (the original file lasts for ~1h) i already have 700MB file :(

How can I maintain the original file size and just discard some frames?

Thx!!!

ps: i am trying to get the original codec using this code:

int ex = static_cast<int>(inputVideo.get(CV_CAP_PROP_FOURCC));

but apparently ex = 0 ??

OpenCV doesn't support all types of containers/codecs, for instance MKV is not supported. This page has an interesting info on the subject.

And this list shares some of the FourCC codes that are currently supported.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM