VideoWriter error invalid type

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?

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);

that is not the proper argument for PROP_DEPTH. it takes just the type, not the channel count.

I changed the dtype to CV_8U and now get:

to load OpenH264 library: openh264-1.8.0-win64.dll
Please check environment and/or download library: Releases · cisco/openh264 · GitHub

[libopenh264 @ 0000020b02a92a80] Incorrect library version loaded
[ERROR:0@14.341] global cap_ffmpeg_impl.hpp:3076 open Could not open codec libopenh264, error: Unspecified error (-22)
[ERROR:0@14.342] global cap_ffmpeg_impl.hpp:3093 open VIDEOIO/FFMPEG: Failed to initialize VideoWriter

However if I remove the cv::CAP_FFMPEG argument then it is opened ok.