How to write MP4 with OpenCV3

When trying to write MP4 file (H264), I tired code of

And I got error saying:

This problem is solved by changing the fourcc to the ASCII number directly to cv2.VideoWriter(), i.e.


Install Dlib on Visual Studio 2015

Step1: Download Dlib Download Dlib from and extract. Download face landmark detection predictor data Step2: Use cmake to generate library Use cmake to build the library. Set the directories as shown in the Figure 1 below Click “Generate” and set the configuration as shown in Figure 2 Click “Finish” Go to “C:/Users/xmeng525/Dropbox/OPENCV_STUDY/dlib-19.4/build”, open the Dlib solution … Read moreInstall Dlib on Visual Studio 2015

Store array to Mat



  而取元素值时不能写成”,y)”或者”<a.type()>(x,y)”。 所以这里列出OpenCV中定义的型别和C++中型别的对应关系,   CV_8SC1 -> char CV_8UC1 -> unsigned char CV_16SC1 -> short CV_16UC1 -> unsigned short CV_32SC1 -> int CV_32FC1 -> float CV_64FC1 -> double OpenCv中的数据型别命名规则为:CV_(比特数)+(数据类型)+(Channel数),我们也可以直接根据命名规则得到相应的数据型别。   下面举例: