rahulch

Untitled

Mar 13th, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. QVideoFrame VideoFilterRunnable::run(QVideoFrame* input,
  2.                                      const QVideoSurfaceFormat& surfaceFormat,
  3.                                      QVideoFilterRunnable::RunFlags flags)
  4. {
  5.    
  6.  
  7.     if (input->isValid()) {
  8.         if (input->map(QAbstractVideoBuffer::ReadOnly)) {
  9.             cv::Mat img = cv::Mat(m_videoHeight, m_videoWidth, CV_8UC3, input->bits());
  10.             imwrite("testdms.png", img);
  11.         } else {
  12.             qDebug() << "error while mapping frame";
  13.         }
  14.     } else {
  15.         qDebug() << "invalid input";
  16.     }
  17.  
  18.     return *input;
  19. }
Add Comment
Please, Sign In to add comment