summaryrefslogtreecommitdiff
path: root/FAQ.mdwn
blob: b53c619731ef10d99d334edf9aa923a340d77d7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

Also see: 

* **[[GStreamer documentation overview|http://gstreamer.freedesktop.org/documentation/]]** 
* **[[Non-wiki GStreamer FAQ|http://gstreamer.freedesktop.org/data/doc/gstreamer/head/faq/html/index.html]]** 
[[!toc 2]] 


# General


## I wrote a new plugin/element and I would like it to be included in GStreamer, how to proceed?

See [[SubmittingPatches|SubmittingPatches]]. 


## It is hard to give unique names to elements I create, is there no better way to do this?

You can just pass `NULL` as the element name to `gst_element_factory_make`.  GStreamer will assign a unique name automatically in this case. 


## My handler for the message signal of GstBus is never called, how to get it to work?

You need to call `gst_bus_add_signal_watch` to enable emission of the `message` signal.  Also make sure that you have a main loop running (`g_main_loop_run` or e.g. `gtk_main`). 


## How to read the meta data (tags) of a file?

Use a `playbin` element with fakesinks, connect handlers for ERROR and TAG messages and set state to PAUSED. **FIXME** give full code example 


## My pipeline with multiple sinks never reaches the PAUSED state, what am I doing wrong?

You need to add queue elements after the demuxer (or tee element) that you use. 

The problem is that the pipeline will deadlock without queues: When the demuxer/tee element is sending data to the first sink, the flow will block there while going from READY to PAUSED (this is called "prerolling").  Since the flow is blocked inside the first sink, the second sink will never receive any data which means that it can never reach the PAUSED state.  A queue element decouples the flow by sending on data in another thread. 

**FIXME** give example pipelines 


## When capturing from a video and/or audio source, how to make recording stop correctly?

Since (live) video and audio sources provide an endless stream of data until you stop them, some special steps are needed.  These are outlined in the documentation of [[GstBaseSrc|http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer-libs/html/GstBaseSrc.html]] under the section "Controlled shutdown of live sources in applications". 


## How to read raw audio or video content from a file?

The `audioparse` and `videoparse` elements can be used for this. **FIXME** Give examples/link to element docs. **FIXME** Since they are in -bad, maybe explain the old method of capsfilter + filesrc-blocksize. 


## How to turn a list of image files into a video file?

This can be done with the `multifilesrc` element. **FIXME** Give example/link to element docs. 


## I installed new LADSPA modules/libvisual plugins but the corresponding GStreamer elements do not show up, what's going on?

First make sure that the needed plugin is installed (ladspa from gst-plugins-bad, libvisual from gst-plugins-base).  You can verify that by checking the output of `gst-inspect-0.10 ladspa` (`gst-inspect-0.10 libvisual`). 

If the GStreamer plugin is installed properly, you have to force a registry update: 


[[!format txt """
rm -fv ~/.gstreamer-0.10/registry*
"""]]
Unfortunately this step is needed everytime the set of LADSPA modules/libvisual plugins changes.  [[Bug #350477|http://bugzilla.gnome.org/show_bug.cgi?id=350477]] is keeping track of this issue. 


# gst-python


## My pygst program is mysteriously core dumping, how to fix this?

Make sure that you initialize glib threading by using `gobject.threads_init()` very early in your program.  The full import stanza that every pygst program should have looks like this: 


[[!format txt """
import pygtk
pygtk.require ("2.0")
import gobject
gobject.threads_init ()
import pygst
pygst.require ("0.10")
import gst
"""]]

## How to get a list of all elements available in the registry?

Use the `get_feature_list` method of the default registry: 


[[!format txt """
>>> import pygst; pygst.require ("0.10")
>>> import gst
>>> registry = gst.registry_get_default ()
>>> registry.get_feature_list (gst.ElementFactory)
[<gst.ElementFactory bin @ 0x87fb874>, <gst.ElementFactory pipeline @ 0x87fbc84>, <gst.ElementFactory dvdsrc @ 0x87fbc5c>,
...
"""]]


---

 [[CategoryHomepage|CategoryHomepage]]