I am getting an error:
INFO:0@2.673] global backend_plugin.cpp:169 cv::impl::PluginBackend::checkCompatibility Video I/O: initialized 'FFmpeg OpenCV Video I/O Writer plugin': built with OpenCV 4.8 (ABI/API = 1/1), current OpenCV version is '4.8.0' (ABI/API = 1/1)
[ INFO:0@2.673] global backend_plugin.cpp:103 cv::impl::PluginBackend::initWriterAPI Video I/O: plugin is ready to use 'FFmpeg OpenCV Video I/O Writer plugin'
[ WARN:0@4.810] global cap_ffmpeg_impl.hpp:2691 open Unsupported depth/isColor combination is selected, only CV_8UC1/CV_8UC3/CV_16UC1 are supported.
But the code appears to be correct:
int frames_per_second = 30;//nominal
int frame_width = 720; //HD 720x480
int frame_height = 480;
frc = cv::VideoWriter::fourcc('H', '2', '6', '4');//file extension should be mpg or replace H with X
file_ext = "mp4";//or m4v?
params = { cv::VIDEOWRITER_PROP_DEPTH, CV_8UC3, cv::VIDEOWRITER_PROP_IS_COLOR, true };
vid = cv::VideoWriter(vid_file + file_ext, cv::CAP_FFMPEG, frc, frames_per_second, frame_size, { cv::VIDEOWRITER_PROP_DEPTH, CV_8UC3, cv::VIDEOWRITER_PROP_IS_COLOR, true });
Is there an error in the my code or in the check code:
file: cap_ffmprg_impl.hpp about line 2785
const bool is_supported = depth == CV_8U || (depth == CV_16U && !is_color);