Packaging gst-python

已查看 13 次
跳至第一个未读帖子

MathieuP

未读,
2020年2月21日 04:23:592020/2/21
收件人 pyins...@googlegroups.com
Hey guys,

I'm trying to package an app that's using GStreamer and gst-python using
PyInstaller.

PyInstaller comes with default hooks for Gstreamer, GLib, GI etc, and all of
that seems to be working fine for me. I am struggling with adding gst-python
though, even though a comment on hook-gi.repository.Gst.py states that it
was tested with gst-python 1.4.0
<https://github.com/pyinstaller/pyinstaller/blob/develop/PyInstaller/hooks/hook-gi.repository.Gst.py#L16>
and people are mentioning they could include pygst (a deprecated version of
gst-python) on Stack Overflow.

/In case you are not familiar with gst-python, it is a way to write
GStreamer elements in Python instead of writing them in C. The plugin will
introspect all Python files that are in a specific folder, and discover the
ones that "look like" GStreamer elements to allow you to use them as normal
GStreamer elements./

What I've done so far


- I wrote a bunch of elements in Python, including a dummy test element for
tests: https://pastebin.com/WDdBsZLk

- I am building gst-python from source, against my local install of Python:

This plugin and the test element I just sent work fine on my host.

- I wrote a simple entry script for PyInstaller that imports Gst from
gi.repository, which works fine. I'm also providing additional data in my
spec file:

so that my element gets included too.

- I exported GST_PLUGIN_PATH to point to my exported python folder, since
this is part of the specs from gst-python so that they can know where the
Python scripts they should introspect are located.

The exported app then seems to be including everything I need to run
gst-python with my element:


- The gst-python plugin is there:


- My test element is there too:


Running my app


However, when I try running my entry script (a simple script that runs the
simplest possible pipeline using my dummy element: /videotestsrc !
nirotest/), it will error out, saying:


Is it possible that a bug in the support of gst-python got introduced after
1.4.0? Or are there any additional steps that need to be made to support
this kind of library?

Cheers.



--
Sent from: http://pyinstaller.47505.x6.nabble.com/

MathieuP

未读,
2020年2月24日 04:34:252020/2/24
收件人 pyins...@googlegroups.com
The important parts didn't make it through Nabble, so I'll add them here.

Here is how I build gst-python:
--with-libpython-dir="/usr/lib/python3.6/config-3.6m-x86_64-linux-gnu"

The additional data I pass in my spec file:
("gst_niro_test.py", "python")

The gst-python plugin is located there:
gst_plugins/libgstpython.cpython-36m-x86_64-linux-gnu.so

My test element is in:
python/gst_niro_test.py

And the error I have trying to run it is:
(entry:11): GStreamer-WARNING **: 22:23:36.187: Element factory metadata for
'nirotest' has no valid long-name field
Traceback (most recent call last):
File "entry.py", line 13, in <module>
GLib.Error: gst_parse_error: no element "nirotest" (1)
[11] Failed to execute script entry
回复全部
回复作者
转发
0 个新帖子