Click here to Skip to main content
15,886,724 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
there are a lot of questions asked regarding opencv + H.264 but none of them gave detailed explanation.

i am using openh264(openh264-1.4.0-win32msvc.dll) along with opencv 3.1(custom build with cmake having ffmpeg enabled) in visual studio, i wanted to save video coming from webcam in mp4 format with H.264 compression

Objective-C
VideoWriter write = VideoWriter("D:/movie.mp4", CV_FOURCC('H', '2', '6', '4'), 10.0, cv::Size(192, 144), true);


before using openh264, in console window i was seeing an warning message "Failed to load openh264 library : openh264-1.4.0-win32msvc.dll please check your environment and/or download from here: https://github.com/cisco/openh264/releases" (also video was not been saved)

so i downloaded the dll & kept in a folder with my program file(exe) now when i run the program, i'm seeing different error "[OpenH264] this = 0x0DE312C0, warning: bEnabledFrameSkip=0, bitrate can't be controlled for RC_QUALITY_MODE and RC_TIMESTAMP_MODE without enabling skip frame" (now video is saved, but size is very high! bit rate is around 1200 Kbps)

for me, the sole purpose of using h264 is to reduce the file size.. i think i may have to build openh264 myself with some changes to remove this error, can anyone guide me how? or tell me if there is a way to reduce bit rate somehow through code?

Thanks & Regards

What I have tried:

I tried giving -1 instead of CV_FOURCC(), 'installed codecs' window in my system showed up, i couldn't find h264 or x264 or h264vfw even though i have installed variety of codec packs & h264 from here
Posted
Updated 9-Apr-16 15:59pm
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900