Setup Gstreamer Python Binding
Install Gstreamer through package manager
See here.
apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
Use conda to install dependencies
See here.
conda install -c conda-forge pygobject gobject-introspection gtk3 gst-python gst-plugins-base gst-plugins-good
Configure Gstreamer plugin lib path
See here.
Run
locate libgstautodetect.so
to get the plugin lib path. Then add the path to the environment:
export GST_PLUGIN_SYSTEM_PATH_1_0=$GST_PLUGIN_SYSTEM_PATH_1_0:#PATH#
Verification
import gi
gi.require_version("Gtk", "3.0")
from gi.repository import Gtk
window = Gtk.Window(title="Hello World")
window.show()
window.connect("destroy", Gtk.main_quit)
Gtk.main()
This should show a window. See here.
gst-launch-1.0 videotestsrc ! autovideosink
This should show a window with test video.
gst-inspect-1.0 autovideosink
This should show info about autovideosink.