Makes using GStreamer in python easy!
Project description
A re-imagining of gstreamer-python. I was going to just work on a fork of that repo but there was so much I thought should be changed. Some of the new features:
- Auto detect caps if in gst-launch command
- Auto detect and configure
appsinkandappsrcif in command - Support for
appsinkandappsrcin same pipeline - Faster
Gst.Sample->ndarray
Example Usage
Also check out the user_code.py script for an appsrc example.
Simple pipeline without an appsink element:
simple_cmd = "videotestsrc num-buffers=60 ! autovideosink"
with GstPipeline(simple_cmd) as pipeline:
print("Running simple pipeline")
Pipeline with an appsink element:
appsink_cmd = "videotestsrc num-buffers=60 ! appsink emit-signals=true sync=false"
with GstPipeline(appsink_cmd) as pipeline:
while pipeline:
buffer = pipeline.pop()
if buffer:
type(buffer.data) # np.ndarray
Pipeline using tee element and multiple sinks:
tee_cmd = '''
videotestsrc num-buffers=60 ! tee name=t
t. ! queue ! video/x-raw,format=RGB,framerate=60/1
! appsink emit-signals=true sync=false
t. ! queue ! video/x-raw,format=RGB,framerate=60/1
! jpegenc ! avimux
! filesink location=recording.mp4
'''
with GstPipeline(tee_cmd) as pipeline:
while pipeline:
buffer = pipeline.pop()
# do whatever you want with the buffer's ndarray
# Meanwhile recording.mp4 is being written
Develop
All dev tasks can be handled with the run.sh script but it just wraps standard
tools if you can't/don't want use it.
python -m pip install -e .[dev,doc]to install depstoxto run tests for py3.7 and py3.10.flake8andmypyfor lintingpdoc -d google src/gstreasyfor online docs
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gstreasy-0.1.0.tar.gz.
File metadata
- Download URL: gstreasy-0.1.0.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
010165e7bf0f5cc07f8e9810968f9e17ddf79ba97de4e6aa8762424265eee17f
|
|
| MD5 |
89f5968ba31c888a44fd7c6d8de2be30
|
|
| BLAKE2b-256 |
c68b7acfcfecb11bdcb129c5d30d7f1c5f15bdf128c4893329d4c92a117ffc06
|
File details
Details for the file gstreasy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gstreasy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 13.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a085d449c3af02780221e21c6b48b371cb021ee730f5d18f3557185d3a121fb8
|
|
| MD5 |
eac7f1abcae19c179890926c43c02ca5
|
|
| BLAKE2b-256 |
75f356b9161ff2979c29bfa6d2d8ae85ef76ff46779b5a1667c9c12b552d15f3
|