fade effect with Gstreamer textoverlay element - gstreamer

I want the gstreamer textoverlay element to render text with a fade-in/fade-out effect. The released version does not do this. Does anyone know of a fork or a similar plugin that can do this?

Related

Display a video using imgui

I'm trying to create an interface that would allow me to drive a remote controlled car.
I was wondering if it were possible to display a video using ImGui ? I know I can split my video into several frames and display each frames one after the other but is there any other way to do this ?
Thank you !
Yes, it is possible to display a video in dear ImGui
Above picture shows the sample of displaying from the webcam feed using ESCAPI.
refer https://github.com/jarikomppa/escapi/ for more details.
I once developed an application using imgui that displayed video via imgui, and it did work, but there was performance limitations. If you dont need to display more than 8 feeds at a time, you should be okay.
You'll need an appsink on your gst pipeline, and then in the appsink you need to pull the gstbuffer and convert it to a GL texture, then pass the GL texture to imgui.
You can reference this repo, its the same one i used as a starting block:
https://github.com/tbeloqui/gst-imgui

GStreamer add video overlay when recording screen to filesink

Hello i am recording screen to video file with GStreamer ximagesrc element using QT.
I want to draw circles on mouse clicks locations.
Can someone give a hint how to achieve this, looking at GstVideoOverlay I understand that it is used only on playing video in some window and draw in that window not directly in video stream that could be saved to file. Guessing that GstVideoOverlayRectangle can help here, but i`m not sure...
Thanks :)
I would recommend to look at cairooverlay:
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good/html/gst-plugins-good-plugins-cairooverlay.html

Red artifact on visualizing rtsp stream via gstreamer and qt5

I've written a c++ program that receives a RTSP stream via gstreamer and displays this video via Qt5 in a QWidget. As the gstreamer videosink, I use a Widgetqt5glvideosink.
The problem is when I look at the received stream it has too much red-value in it. This only occurs when the vertical resolution exceeds +-576 pixels. (lower resolutions have no issue)
When I use cpu rendering (Widgetqt5videosink) instead of openGL rendering i get a correct image.
When I view the stream via gstreamer command line or via VLC it is also correct.
So it likes to be an issue when using an openGL rendered QWidget.
Is this an driver issue or something else?
Info:
Tested on Ubuntu16.04 and 17.04 for the viewer application.
Links:
https://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/qtvideosink_overview.html
I managed to fix my problem by patching two files in the source code of qt-gstreamer.
There were two wrong color matrices of the colorimetry BT709.
Patch to fix red artifact in Widgetqt5glvideosink

How to add a gstreamer 1.0 video element to a qt5 app

I'm trying to play video in a Qt widget on linux.
How to implement a video widget in Qt that builds upon GStreamer?
The above question is pretty close to what I want, but 6 years old. QApplication::syncX(); no longer exists in qt5 so I dropped that. I've also changed gst_x_overlay_set_xwindow_id() to gst_video_overlay_set_window_handle for the gstreamer version change.
My pipeline works if I don't pass any window handle to the video sink (it just pops up a new window with the video). I'm not sure if I'm missing something to get it to render inside of Qt though.
EDIT
I can set the entire app window as the overlay, but not a subsection of the main widget. Also, couldn't get the appsink working, but glimagesink seems to work.
// QWidget* widget = QApplication::activeWindow(); // this works
QWidget* widget = new QWidget(ui->base_widget); // this doesn't work
widget->setAttribute(Qt::WA_NativeWindow, true);
widget->resize(320,240);
widget->update();
widget->setStyleSheet("background-color: red");
widget->show();
winId = widget->winId();
QApplication::sync();
gst_video_overlay_set_window_handle(GST_VIDEO_OVERLAY(sink) , winId);
If the purpose here is to just render video you can use autovideosink which will create a suitable window for you and you would not need to worry about handling this manually.
However if you still want to render this on a widget window say, try the appsink, read the frames on the sink and use the onPaint event in your widget to render the frames. Just be sure the frames are in format which can be rendered like RGB you can do that via the videoconvert or ensure format via the capsfilter. You might also be able to use glimagesink and pass that your window id to render the frames.
if you want to render the video on a qvideowidget using appsink as mentioned above you could try:
video_widget->setAttribute(Qt::WA_NativeWindow, true);
WId win_id = video_widget->winId();
QApplication::sync();
gst_x_overlay_set_window_handle(GST_X_OVERLAY(data->appsink), win_id);

Key callbacks with gstreamer

I was wondering if anyone has any idea of how to do key callbacks with gstreamer. I've looked, and can't find anything. I'm trying to do the equivalent of cvWaitKey. I do have OpenCV in my program and it can interact with Gstreamer. However, Gstreamer is outputting the video to the screen thus cvWaitKey doesn't work.
Thanks!
This has nothing to do with GStreamer. Pick a UI toolkit like Gtk+ or Qt and use the functionality there.