GES タイムラインに 3 つのファイルを追加する次の Python コードは、他の人にも発生した次のエラーをスローします。
(GError('Your GStreamer installation is missing a plug-in.',), 'gstdecodebin2.c(3928): gst_decode_bin_expose (): /GESPipeline:gespipeline0/GESTimeline:gestimeline0/GESVideoTrack:gesvideotrack0/GnlComposition:gnlcomposition1/GnlSource:gnlsource0 /GstBin:videosrcbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin4:\n適切なプラグインが見つかりません')
from gi.repository import GES
from gi.repository import GstPbutils
from gi.repository import Gtk
from gi.repository import Gst
from gi.repository import GObject
import sys
import signal
VIDEOPATH = "file:///path/to/my/video/folder/"
class Timeline:
def __init__(self, files):
print Gst._version # prints 1
self.pipeline = GES.Pipeline()
container_caps = Gst.Caps.new_empty_simple("video/quicktime")
video_caps = Gst.Caps.new_empty_simple("video/x-h264")
audio_caps = Gst.Caps.new_empty_simple("audio/mpeg")
self.container_profile = GstPbutils.EncodingContainerProfile.new("jane_profile", "mp4 concatation", container_caps, None )#Gst.Caps("video/mp4", None))
self.video_profile = GstPbutils.EncodingVideoProfile.new(video_caps, None, None, 0)
self.audio_profile = GstPbutils.EncodingAudioProfile.new(audio_caps, None, None, 0)
self.container_profile.add_profile(self.video_profile)
self.container_profile.add_profile(self.audio_profile)
self.bus = self.pipeline.get_bus()
self.bus.add_signal_watch()
self.bus.connect("message", self.busMessageCb)
self.timeline = GES.Timeline.new_audio_video()
self.layer = self.timeline.append_layer()
signal.signal(signal.SIGINT, self.handle_sigint)
self.start_on_timeline = 0
for file in files:
asset = GES.UriClipAsset.request_sync(VIDEOPATH + file)
print asset.get_duration()
duration = asset.get_duration()
clip = self.layer.add_asset(asset, self.start_on_timeline, 0, duration, GES.TrackType.UNKNOWN)
self.start_on_timeline += duration
print 'start:' + str(self.start_on_timeline)
self.timeline.commit()
self.pipeline.set_timeline(self.timeline)
def handle_sigint(self, sig, frame):
Gtk.main_quit()
def busMessageCb(self, unused_bus, message):
print message
print message.type
if message.type == Gst.MessageType.EOS:
print "eos"
Gtk.main_quit()
elif message.type == Gst.MessageType.ERROR:
error = message.parse_error()
print (error)
Gtk.main_quit()
if __name__=="__main__":
GObject.threads_init()
Gst.init(None)
GES.init()
gv = GES.version() # prints 1.2
timeline = Timeline(['one.mp4', 'two.mp4', 'two.mp4'])
done = timeline.pipeline.set_render_settings('file:///home/directory/output.mp4', timeline.container_profile)
print 'done: {0}'.format(done)
timeline.pipeline.set_mode(GES.PipelineFlags.RENDER)
timeline.pipeline.set_state(Gst.State.PAUSED)
Gtk.main()
GST_PLUGIN_PATH_1_0 環境変数を「/usr/local/lib:/usr/local/lib/gstreamer-1.0:/usr/lib/x86_64-linux-gnu:/usr/lib/i386-linux-gnu/gstreamer」に設定しました-1.0"
gstreamer1.0-1.2.4 を、そのバージョンの基本パッケージ、良いパッケージ、悪いパッケージ、醜いパッケージと共にコンパイルしてインストールしました。GES は、私が見つけた gstreamer バージョンに最も近いバージョン 1.2.1 でインストールされます。libav-1.2.4もインストールしました。
プラグイン ベースの make install ログによると、decodebin2 はベースにある必要があり、私の GST_PLUGIN_PATH_1_0 の一部である libgstplayback にリンクされています。
/usr/local/lib/gstreamer-1.0 libgstplayback_la-gstdecodebin2.lo
私はgstreamer0.10を持っています.decodebin2は、1.0ではなくgstreamer0.10ライブラリパスにあるため、「gst-inspect-1.0 -b」を実行するとブラックリストに登録されたバージョンとして存在します。
~/.cache/gstreamer ファイルをクリアし、再度 gst-inspect-1.0 を実行してプラグイン レジストリを再生成しようとしましたが、それでも Python コードでエラーが発生し続けます。Gstreamer 編集サービスを使用してタイムラインを作成するのは初めてなので、このサンプル コードは間違っている可能性があります。私は Ubuntu Trusty または 14.04 を使用しています。
このファイルは mp4 ファイルであるため、必要なライブラリ用に gst-libav をインストールしました。ファイルの MP4Box -info の出力は次のとおりです。
ムービー情報 * タイムスケール 90000 - デュレーション 00:00:08.405 断片化されたファイル番号 - 2 トラック プログレッシブ ダウンロードに適したファイル (mdat の前に moov) ファイル ブランド mp42 - バージョン 0 作成: GMT 月 8 月 17 日 17:02:26 2015
ファイルに MPEG4 IOD/OD がありません
トラック番号 1 情報 - トラック ID 1 - タイムスケール 50000 - デュレーション 00:00:08.360 メディア情報: 言語 "英語" - タイプ "vide:avc1" - 209 サンプル ビジュアル トラック レイアウト: x=0 y=0 幅=1920 高さ=1080 MPEG-4 構成: ビジュアル ストリーム - ObjectTypeIndication 0x21 AVC/H264 ビデオ - ビジュアル サイズ 1920 x 1080 AVC 情報: 1 SPS - 1 PPS - プロファイル メイン @ レベル 4.2 NAL ユニット長ビット: 32 ピクセル アスペクト比 1:1 - 示されたトラック サイズ1920 x 1080 自己同期
トラック # 2 情報 - TrackID 2 - TimeScale 48000 - デュレーション 00:00:08.405 メディア情報: 言語 "英語" - タイプ "soun:mp4a" - 394 サンプル MPEG-4 構成: オーディオ ストリーム - ObjectTypeIndication 0x40 MPEG-4 オーディオ MPEG- 4 オーディオ AAC LC - 2 チャンネル - SampleRate 48000 ストリーム 1 で同期
'GST_DEBUG=3,gnl*:5 python ./timeline1.py > timesline1.log 2>&1' を実行したときのlog @ pastebin.com/BjJ8Z5Bd