GStreamer is a video streaming framework. When it is first used after installation, an error will be reported when using the Hello World routine in the official doc, as follows:
ImportError: cannot import name GstRtspServer, introspection typelib not found
```python
#!/usr/bin/env python3
import sys
import gi
gi.require_version('GLib', '2.0')
gi.require_version('GObject', '2.0')
gi.require_version('Gst', '1.0')
from gi.repository import Gst, GObject, GLib
pipeline = None
bus = None
message = None
# initialize GStreamer
Gst.init(sys.argv[1:])
# build the pipeline
pipeline = Gst.parse_launch(
"playbin uri=https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm"
)
# start playing
pipeline.set_state(Gst.State.PLAYING)
# wait until EOS or error
bus = pipeline.get_bus()
msg = bus.timed_pop_filtered(
Gst.CLOCK_TIME_NONE,
Gst.MessageType.ERROR | Gst.MessageType.EOS
)
# free resources
pipeline.set_state(Gst.State.NULL)
“209151;”
sudo apt-get install gir1.2-gst-rtsp-server-1.0
Read More:
- How do I download or save a YouTube video to my computer?
- Beatifulsoup MAC installation solution Python 3
- Dpkg: error processing package XXX (- – configure) solution (red warning in the upper right corner of Ubuntu)
- Cesium uses mediastreamrecorder or mediarecorder to record and download videos, and turn on the camera for recording.
- Opne GL es learning experience!
- The problem of “value error: zero length field name in format” in Python 2.6.6 of CentOS 6.9
- ModuleNotFoundError: No module named ‘numpy.testing.nosetester‘
- Introduction to total phase data center
- Fatal error in CentOS: Python. H: no that file or directory
- RuntimeError: NCCL error in: /pytorch/torch/lib/c10d/ProcessGroupNCCL.cpp:784 torch
- Installing the basemap package in Anaconda
- Centos7 view and close firewall
- [solved] runtimeerror: module compiled against API version 0xc but this version of numpy is 0xb
- Data analysis to obtain Yahoo stock data: some problems are encountered when using panda datareader (cannot import name ‘is_ list_ Like ‘problem)
- /usr/sbin/zabbix_agentd: error while loading shared libraries: libcurl.so.4
- From in Python__ future__ The role of import *
- Attributeerror: module tensorflow no attribute app solution
- Pandas memory error
- Linux update Python method and error handling
- Install in Python 3. X web.py