GESのタイムラインに3つのファイルを追加し、次のPythonコードは、他の人も持っていた次のエラーをスローします。Gstreamer1.0不足しているプラグイン:Pythonコードでdecodebin2
(GErrorを格納(「あなたのGStreamerのインストールが欠落していますプラグイン、 '、)、' gstdecodebin2.c(3928):gst_decode_bin_expose():/ GESPipeline:gespipeline0/GESTimeline:gestimeline0/GESVideoTrack:gesvideotrack0/GnlComposition:gnlcomposition1/GnlSource:gnlsource0/GstBin:videosrcbin/GstURIDecodeBin:uridecodebin0/GstDecodeBin :decodebin4:私はGST_PLUGIN_PATH_1_0環境変数を設定している
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()
\ NNO、適切なプラグインが見つから ') "/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はバージョン1.2.1と一緒にインストールされていますが、これは私が見つけたgstreamerバージョンに最も近いバージョンです。私もlibav-1.2.4をインストールしました。
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トラック(S) ファイルプログレッシブダウンロード(MOOVに適しMDAT前) ファイルブランドMP42 - 作成されたバージョン0 : - TrackID 1 - タイムスケール50000 - GMT月8月17日午後05時02分26秒2015
ファイルが
トラック#1情報なしMPEG4 IOD/ODを持っていない期間00:00:08.360 メディアタイプ:言語 "英語" - タイプ "ビデオ:avc1" - 209サンプル ビジュアルトラックレイアウト:x = 0 y = 0 width = 1920 height = 1080 MPEG-4設定:ビジュアルストリーム - ObjectTypeIndication 0x21 AVC/H264ビデオ - ビジュアルサイズ1920×1080 AVC情報:示されたトラックサイズ1920×1080 自己同期
- 1:32 ピクセルアスペクト比1:1つのSPS - - 1 PPSは、メイン@レベル4.2 NALユニット長ビットにプロフィールトラック#2情報 - トラックID 2 - TimeScale 48000 - 継続時間00:00:08。405 メディアの種類:言語 "英語" - タイプ "soun:mp4a" - 394サンプル MPEG-4設定:オーディオストリーム - ObjectTypeIndication 0x40 MPEG-4オーディオMPEG-4オーディオAAC LC-2チャンネル(秒) - SampleRate 48000 1
ログpastebin.com/BjJ8Z5Bd @私が実行したときのためにストリーム上で同期 'GST_DEBUG = 3、GNL *:5のpython ./timeline1.py> timeline1.log 2> & 1'
ハイセバスチャン、Gstreamerプロジェクトの重要な貢献者としてあなたの名前を認識してくれてありがとうございます。Gstreamerがビデオ制作の基礎となることを願っています。 MP4BoxのMP4の詳細が私の質問に追加されます。私のコードがGstreamer0.10ベースの要素を求めているのはなぜですか? –
container_capsを 'video/quicktime'から 'video/mpeg'( 'version'を4に設定)に変更しようとしました。しかし、 'timeline.pipeline.set_render_settings(' file:///home/ian/output.mp4 '、timeline.container_profile)'はfalseを返し、何も再生されません。 –
それは0.10の要素を求めていません。あなたがどこにdecodebin2を求めているか分かりません:) 問題は出力形式ではありませんが、問題は入力ファイルを読み込んでそれを解読することです。どのような入力ファイルを使用していますか?あなたは出力のために何かを見逃しているかもしれませんが、まだその時点でさえありません。 –