How to get nv12 image from VideoFiles(ex: h264) using OpenCV library(cv::VideoCapture)?
I need to use opencv without FFMPEG, Gstreamer and others. Also, I have to read image frame from video file as nv12 directly(without format conversion) by OpenCV API, and I thought it might possible because the videofiles has been encoded as nv12 format.
I couldn't find supported image fromat of cv::VideoCapture::read() from OpenCV Reference site.
https://docs.opencv.org/4.x/d8/dfe/classcv_1_1VideoCapture.html
However, when I tried to read image frame using cv::VideoCapture, only it read frame as BGR888.
I tried followings, but both set() is not effected to the read result.
cv::VideoCapture vc("file path");
vc.set(cv::CAP_PROP_FOURCC, cv::VideoWriter::fourcc('N', 'V', '1', '2'));
vc.set(cv::CAP_PROP_FORMAT, cv::COLOR_YUV2BGR_NV12);
Would you let me know how to read nv12 image frame using cv::VideoCapture or other API in OpenCV?