Record video with Overlay
-
That's because the recorder acts on the camera itself. It doesn't care about whatever you put on top of the preview content.
One way would be to modify the gstreamer backend so it produces the overlay you want on top of your video.
-
Hi,
Thanks for the answer. I searched but didn't get the idea to modify gstreamer backend.
Let me know the method or some reference link/site to modify gstreamer backend to perform overlay.Thanks!
-
Did you first check whether GStreamer capabilities fill your need in term of overlay ?
-
Yes facing same issue here...Hopefully will find an appropriate answer from here..As no proper source on google regarding gstreamer backend is available.Thanks MySchoolBucks
-
@SGaist
Hi Gaist,Thank you for your time.
I have checked capabilities of Gstreamer to record video with overlay text using below gstreamer command:
gst-launch-1.0 -e v4l2src ! textoverlay text="Name" valignment=top halignment=left font-desc="Sans, 24" ! queue ! x264enc ! h264parse ! queue ! qtmux ! filesink location=testVideoI have tried below methods with QT but didn't work out:
-
Create Object of "QGstreamerVideoOverlay", but it gives declaration error.
-
Do Gstreamer modification with below code, but didn't know how to set overlay text. It gives only live video in "grahicsview".
*gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY("autovideosink"),graphicsView->viewport()->effectiveWinId());
GstMessage msg = new GstMessage();
gst_is_video_overlay_prepare_window_handle_message(msg);
Thanks,
Nikita -
-
I was rather thinking about the textoverlay plugin of GStreamer.
-
use QAbstractVideoFilter for overlaying and recording
-
I was rather thinking about the textoverlay plugin of GStreamer.
@SGaist
I didn't know how to integrate "textoverlay plugin" with QMediaRecorder.It would be great if you can provide a reference document or link to use it.
Thanks,
Nikita -
use QAbstractVideoFilter for overlaying and recording
@vladstelmahovsky
Let me know how to use "QAbstractVideoFilter" to write text and use it with QMediaRecorder.It would be great if you can provide a reference document or link to use it.
Thanks,
Nikita -
@vladstelmahovsky
Let me know how to use "QAbstractVideoFilter" to write text and use it with QMediaRecorder.It would be great if you can provide a reference document or link to use it.
Thanks,
Nikita@nikita.panchal09
you can read https://blog.qt.io/blog/2015/03/20/introducing-video-filters-in-qt-multimedia/
to get an idea about how to handle frames
each frame can be converted to QImage and each QImage can be used to draw text on it and provided to media recorder