I am stuck in finding help on my next project. My use case as follows,
1) Read frames from a mp4 file.
2) Detect faces inside the frames.
3) Store or Display the final output.
"same use case to be executed with a YUV420P (raw) video"
Am very very new to openCV platform but am quite familiar with gstreamer and linux interface programming.
Please help me to find any reference (example) for the same.
When you are familiar with GStreamer - there is a OpenCV facedetect element: https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-bad-plugins/html/gst-plugins-bad-plugins-facedetect.html.
Reading and writing raw video data should be trivial for you then I guess? ;-)
There is a very similar post on OpenCV's forum. Basically you have to build your OpenCV from source and enable the extra features for working with additional video formats. For that you need ffmpeg (which you will probably also have to build from source), gstreamer (if you want to use it) and fourcc, which allows you to call cv::CreateVideoCapture() with CV_FOURCC(...) set to the codec you are using (the list of abrevations can be found here).