gst-python issueshttps://gitlab.freedesktop.org/gstreamer/gst-python/-/issues2023-05-22T08:58:30Zhttps://gitlab.freedesktop.org/gstreamer/gst-python/-/issues/78"typefind:sink" received signal SIGSEGV, Segmentation fault2023-05-22T08:58:30ZLaukik Mujumdar"typefind:sink" received signal SIGSEGV, Segmentation faultHere's a python file that I'm having a segmentation fault with on Arm64 machines. I am using Oracle Linux 7 (OL is based on RHEL), and I'm having seg faults when I try to run a pipeline using the python bindings. For instance, consider t...Here's a python file that I'm having a segmentation fault with on Arm64 machines. I am using Oracle Linux 7 (OL is based on RHEL), and I'm having seg faults when I try to run a pipeline using the python bindings. For instance, consider this file (trial_pipeline.py).
```python
import os, platform
import gi
import argparse
import faulthandler
gi.require_version('GLib', '2.0')
gi.require_version('Gst', '1.0')
from gi.repository import GLib, Gst
LINUX_GST_PLUGIN_PATH = '/usr/local/lib64/gstreamer-1.0'
GST_DEBUG_DUMP_DOT_DIR = os.getcwd()
def setup_gstreamer_path():
os.environ['GST_PLUGIN_PATH'] = LINUX_GST_PLUGIN_PATH
os.environ['GST_DEBUG_DUMP_DOT_DIR'] = GST_DEBUG_DUMP_DOT_DIR
os.environ['GST_DEBUG'] = '2'
def parse_launch(input_location, output_location):
if not Gst.is_initialized():
setup_gstreamer_path()
Gst.init(None)
pipeline_string = f"filesrc location={input_location} ! decodebin ! audioconvert ! wavenc ! filesink location={output_location}"
print(f"Running this pipeline: gst-launch-1.0 {pipeline_string}")
_pipe = Gst.parse_launch(pipeline_string)
_loop = GLib.MainLoop()
_pipe.set_state(Gst.State.PLAYING)
_loop.run()
if __name__ == "__main__":
faulthandler.enable()
print(f"Platform: {platform.platform()}, running on architecture: {platform.architecture()}")
print(f"Gi version = {gi.__version__}")
print(f"GLib version = {(GLib.MAJOR_VERSION, GLib.MINOR_VERSION, GLib.MICRO_VERSION)}")
print(f"Gstreamer initialized, version {Gst.version_string()}")
parser = argparse.ArgumentParser(description="This is a test program.")
parser.add_argument("input", metavar='input', type=str)
parser.add_argument("output", metavar='output', type=str)
args = parser.parse_args()
parse_launch(args.input, args.output)
```
This yields:
```
Platform: Linux-5.4.17-2136.318.7.1.el7uek.aarch64-aarch64-with-glibc2.17, running on architecture: ('64bit', '')
Gi version = 3.44.1
GLib version = (2, 56, 1)
Gstreamer initialized, version GStreamer 1.22.2
Running this pipeline: gst-launch-1.0 filesrc location=/stereo_48khz_mixed.mp3 ! decodebin ! audioconvert ! wavenc ! filesink location=/random.wav
0:00:00.062994769 2629 0x3a910f20 WARN basesrc gstbasesrc.c:3693:gst_base_src_start_complete:<filesrc0> pad not activated yet
Fatal Python error: Segmentation fault
Thread 0x0000fffcdf875b70 (most recent call first):
File "/odosvc/.local/lib64/python3.8/site-packages/gi/overrides/GLib.py", line 497 in run
File "trial_pipeline.py", line 31 in parse_launch
File "trial_pipeline.py", line 46 in <module>
Segmentation fault (core dumped)
```
However, if I run the pipeline in the command line:
```shell
$ gst-launch-1.0 filesrc location=/stereo_48khz_mixed.mp3 ! decodebin ! audioconvert ! wavenc ! filesink location=/random.wav
```
it is successful, and I do see /random.wav in my container.
When I run it with gdb, I see this backtrace:
```
Thread 0x0000fffce8b25b70 (most recent call first):
File "/odosvc/.local/lib64/python3.8/site-packages/gi/overrides/GLib.py", line 497 in run
File "trial_pipeline.py", line 31 in parse_launch
File "trial_pipeline.py", line 46 in <module>
Thread 2 "typefind:sink" received signal SIGSEGV, Segmentation fault.
0x0000fffce869074c in raise () from /lib64/libpthread.so.0`
```
The fact that I am seeing this only when I run the python bindings leads me to believe that perhaps I installed gst-python incorrectly. I compiled it from source using meson. The command for that is
```shell
cd ./gstreamer-1.22.2 && meson ./build && cd ./build && ninja && sudo ninja install
```
which seems to have worked well.
Any hints would be appreciated, apologies if this is a duplicate.
Edit: If I use the same gstreamer install scripts in the dockerfile for the x86 image, it works without segmentation faults.https://gitlab.freedesktop.org/gstreamer/gst-python/-/issues/34webrtcbin: GstWebRTC.WebRTCRTPTransceiver field 'direction' is incorrectly re...2020-03-31T08:05:10ZHunter Smithwebrtcbin: GstWebRTC.WebRTCRTPTransceiver field 'direction' is incorrectly read-onlyThe field `GstWebRTC.WebRTCRTPTransceiver.direction` is mistakenly set to be read-only, preventing tranceivers' direction to be set to e.g. `GstWebRTC.WebRTCRTPTransceiverDirection.SENDONLY`. While GstWebRTC isn't documented, [this demo ...The field `GstWebRTC.WebRTCRTPTransceiver.direction` is mistakenly set to be read-only, preventing tranceivers' direction to be set to e.g. `GstWebRTC.WebRTCRTPTransceiverDirection.SENDONLY`. While GstWebRTC isn't documented, [this demo shows that the field should be writable.](https://github.com/centricular/gstwebrtc-demos/blob/master/sendonly/webrtc-unidirectional-h264.c#L207)https://gitlab.freedesktop.org/gstreamer/gst-python/-/issues/13Changing the returned data from the buffer so that it can be modified and rea...2023-08-01T16:14:41ZBugzilla Migration UserChanging the returned data from the buffer so that it can be modified and read without copying## Submitted by Daniel Klamt
**[Link to original bug (#796499)](https://bugzilla.gnome.org/show_bug.cgi?id=796499)**
## Description
The map function of the buffer element has returned a copy of the c buffer as an bytes object as Map...## Submitted by Daniel Klamt
**[Link to original bug (#796499)](https://bugzilla.gnome.org/show_bug.cgi?id=796499)**
## Description
The map function of the buffer element has returned a copy of the c buffer as an bytes object as MapInfo.data. This is bad when you want to edit the video buffer in an gst-python element because teh bytes element always copies the Data.
Therefor i changed the Buffer functions map and unmap and the class MapInfo to return the data as an memory-view on the c buffer
The MapInfo class has the same attributes as before and should be compatible
Version: 1.14.1
### See also
* [Bug 678663](https://bugzilla.gnome.org/show_bug.cgi?id=678663)https://gitlab.freedesktop.org/gstreamer/gst-python/-/issues/9Gst.Bin __init__ changed behavior between 1.10 and 1.12 GStreamer version2023-07-06T16:40:10ZBugzilla Migration UserGst.Bin __init__ changed behavior between 1.10 and 1.12 GStreamer version## Submitted by Andreu N
**[Link to original bug (#789055)](https://bugzilla.gnome.org/show_bug.cgi?id=789055)**
## Description
In version 1.10 Gst.Bin component behaved like a regular GObject class used in python. I mean, you could...## Submitted by Andreu N
**[Link to original bug (#789055)](https://bugzilla.gnome.org/show_bug.cgi?id=789055)**
## Description
In version 1.10 Gst.Bin component behaved like a regular GObject class used in python. I mean, you could define a new component using Gst.Bin as parent, define properties as GObject.ParamFlags.CONSTRUCT_ONLY and pass values to __init__ method in order to set them.
class MyBin(Gst.Bin):
foo = GObject.Property(type=str,
flags=GObject.ParamFlags.CONSTRUCT_ONLY |
GObject.ParamFlags.READWRITE)
def __init__(self, *args, **kwargs):
Gst.Bin.__init__(self, *args, **kwargs)
# your stuff
my_bin = MyBin(foo='bar')
But currently in Gst version 1.12 it raise an error because it does not pass properties to GObject.Object.__init__.
TypeError: __init__() got an unexpected keyword argument 'foo'
Version: 1.12.x