How To apply video filter for Opencv VideoCapture in C++

Viewed 168

I am using ffmpeg command for recording movie from webcam Device

ffmpeg -f dshow -i video="USB Video Device" -vf scale=in_range=full d:/video.mp4

and I want to apply option openCV library in C++. But I don't know apply "-vf scale=in_range=full" option in code. please help me

cv::VideoCapture m_videoCapture;
m_videoCapture.open(3); // 3 is device ID = USB Video Device 
m_videoCapture.set(CV_CAP_PROP_FRAME_WIDTH, 1920);
m_videoCapture.set(CV_CAP_PROP_FRAME_HEIGHT, 1080);
m_videoCapture.set(CV_CAP_PROP_FPS, 30.00);
// Set vf(VideoFilter) here ? whow?
if (!m_videoCapture.isOpened())
{
    ::MessageBox(NULL, "WebCam Device could not be opened succesfully", "CAM", MB_OK);
    return false;
}
return true;

cv::Mat frame;
while (char(cv::waitKey(100)) != 'q')
{
    m_videoCapture >> frame;
    // shoud I write code here for applying videofilteR?

    if (frame.empty()) break;
}
0 Answers
Related