[opencv] win10使用c++ opencv合成视频

opencv 410,debug模式
方式1:

VideoWriter output_video_writer(video_path_save, CAP_OPENCV_MJPEG,output_video_fps,video_sz);
//或者下面
VideoWriter output_video_writer;
output_video_writer.open(video_path_save, CAP_OPENCV_MJPEG, output_video_fps, video_sz);

报错信息:

OpenCV: FFMPEG: tag 0x00000898/'???' is not found (format 'mp4 / MP4 (MPEG-4 Part 14)')'
[ INFO:0] VideoIO pluigin (GSTREAMER): glob is 'opencv_videoio_gstreamer*.dll', 1 location(s)
[ INFO:0]     - E:\vspro\mysiam\trampolineTrack\output\debug: 0
[ INFO:0] Found 0 plugin(s) for GSTREAMER

方式2:
https://docs.opencv.org/4.1.0/d7/d9e/tutorial_video_write.html

int ex = static_cast<int>(input_video.get(CAP_PROP_FOURCC));
VideoWriter output_video_writer;
output_video_writer.open(video_path_save, ex, output_video_fps, video_sz);

无报错信息,运行正常

方法3:

VideoWriter output_video_writer;
output_video_writer.open(video_path_save, output_video_writer.fourcc('m', 'p', '4', 'v'), output_video_fps, video_sz);

无报错信息,运行正常

你可能感兴趣的:(常用工具,opencv,c++,visual,studio)