0

したがって、gst を使用すると、次のコマンドを実行できます。

import gst
outs = gst.element_factory_list_get_elements(gst.ELEMENT_FACTORY_TYPE_SINK,gst.RANK_NONE)

outs は、使用できる GStreamer SINK の各タイプ (filesink、alsasink、a2dpsink など) の gst.ElementFactory オブジェクトのリストになりました。gi.repository を使用してこれを試してみると:

from gi.repository import Gst
outs = Gst.ElementFactory().list_get_elements(Gst.ELEMENT_FACTORY_TYPE_SINK,Gst.Rank.NONE)

Outs は空のリストを返します。Python2 と Python3 の両方で gi.repository バージョンを試しました。gi.repository から Gtk をインポートして、Gtk ウィンドウを正常にレンダリングできます。GStreamer 呼び出しで何が間違っていますか?

4

1 に答える 1

1

Gst.init を実行すると、うまくいきます (Gst.init がないと、空のリストが表示されます)。

>>> from gi.repository import Gst
>>> Gst.init(None)
[]
>>> outs = Gst.ElementFactory().list_get_elements(Gst.ELEMENT_FACTORY_TYPE_SINK,Gst.Rank.NONE)
>>> outs
[<ElementFactory object at 0x7f3d2c6249b0 (GstElementFactory at 0x1327230)>, <ElementFactory object at 0x7f3d2c624a00 (GstElementFactory at 0x1315490)>, <ElementFactory object at 0x7f3d2c624a50 (GstElementFactory at 0x12f06a0)>, <ElementFactory object at 0x7f3d2c624aa0 (GstElementFactory at 0x132aaf0)>, <ElementFactory object at 0x7f3d2c624af0 (GstElementFactory at 0x12b6ee0)>, <ElementFactory object at 0x7f3d2c624b40 (GstElementFactory at 0x129e0b0)>, <ElementFactory object at 0x7f3d2c624b90 (GstElementFactory at 0x12f52c0)>, <ElementFactory object at 0x7f3d2c624be0 (GstElementFactory at 0x12b8bb0)>, <ElementFactory object at 0x7f3d2c624c30 (GstElementFactory at 0x12ae270)>, <ElementFactory object at 0x7f3d2c624c80 (GstElementFactory at 0x130a590)>, <ElementFactory object at 0x7f3d2c624cd0 (GstElementFactory at 0x12bb250)>, <ElementFactory object at 0x7f3d2c624d20 (GstElementFactory at 0x12bb090)>, <ElementFactory object at 0x7f3d2c624d70 (GstElementFactory at 0x12f80e0)>, <ElementFactory object at 0x7f3d2c624dc0 (GstElementFactory at 0x12a75c0)>, <ElementFactory object at 0x7f3d2c624e10 (GstElementFactory at 0x12a1550)>, <ElementFactory object at 0x7f3d2c624e60 (GstElementFactory at 0x130a670)>, <ElementFactory object at 0x7f3d2c624eb0 (GstElementFactory at 0x12bb4f0)>, <ElementFactory object at 0x7f3d2c624f00 (GstElementFactory at 0x1271c70)>, <ElementFactory object at 0x7f3d2c624f50 (GstElementFactory at 0x12bb410)>, <ElementFactory object at 0x7f3d2c624fa0 (GstElementFactory at 0x12bce30)>, <ElementFactory object at 0x7f3d2c1b1050 (GstElementFactory at 0x12bcc70)>, <ElementFactory object at 0x7f3d2c1b10a0 (GstElementFactory at 0x12bcab0)>, <ElementFactory object at 0x7f3d2c1b10f0 (GstElementFactory at 0x12f5480)>, <ElementFactory object at 0x7f3d2c1b1140 (GstElementFactory at 0x12c0e50)>, <ElementFactory object at 0x7f3d2c1b1190 (GstElementFactory at 0x1316ae0)>, <ElementFactory object at 0x7f3d2c1b11e0 (GstElementFactory at 0x1313510)>, <ElementFactory object at 0x7f3d2c1b1230 (GstElementFactory at 0x1313350)>, <ElementFactory object at 0x7f3d2c1b1280 (GstElementFactory at 0x130c860)>, <ElementFactory object at 0x7f3d2c1b12d0 (GstElementFactory at 0x1316a00)>, <ElementFactory object at 0x7f3d2c1b1320 (GstElementFactory at 0x12aa380)>, <ElementFactory object at 0x7f3d2c1b1370 (GstElementFactory at 0x12aa540)>, <ElementFactory object at 0x7f3d2c1b13c0 (GstElementFactory at 0x12c0bb0)>]
于 2013-12-08T21:44:41.657 に答える