Ivars c5d05fd792 tests | 7 years ago | |
---|---|---|
.. | ||
pygst-sdk-tutorials | 7 years ago | |
pygst-tutorial | 7 years ago | |
GstreamerCodeSnippets-master.zip | 7 years ago | |
README.md | 7 years ago | |
gstreamer-python-player-master.zip | 7 years ago | |
player-minimal.py | 7 years ago | |
player.py | 7 years ago | |
seek.py | 7 years ago |
Various examples of minimalist music players in python, using the new Gstreamer 1.0 API. The point is to cover by example the following implementations using Gstreamer 1.0 and the GTK+3 API:
A simple python conversion of the following bash gstreamer command:
gst-launch-1.0 filesrc location="/path/to/your/file.mp3" ! decodebin ! alsasink
It doesn’t contain any graphical elements (no Gtk window or else). There is a small catch here: the decodebin doesn’t have a source pad before startup, thus, we cannot connect it to the sink before it’s been fed with a stream. We have to wait for it to create its output pad, signal it, and then handler the signal event to connect the pad to the sink’s pad
Instead of a “full” pipeline, here it’s just an example of some adapted code from this page.
It uses the “playbin” element which condenses all the elements from the player.py example into one automagic element.
Mainly a gst1.0 port and simplification of this code.
The simplest possible example of a sound player: a “Play” button, a “Pause” button, and a slider to control the playback position. It makes usage of controls signals to start at stop the element’s playback state, and uses a Glib timer to check on the current position of the stream. When the slider is manually moved, it also makes use of the seek_simple() function to seek in the stream.
You should probably use the official doc as well as the gstreamer1.0 porting tutorial to start using the gstreamer1.0 API while feeding on gst0.10-based examples.