gstreamer-0.10 を使用して、Linux で OGG ファイルからビデオ ストリームのみを再生するようにパイプラインをセットアップしようとしています。gst-launch ユーティリティを使用して、コマンド ラインからこれを行う必要があります。次のコマンドを使用して、オーディオ ストリームとビデオ ストリームの両方を正常に再生できます。
$ gst-launch-0.10 playbin uri=file:///projects/demo.ogv
次のコマンドを使用して、ビデオ テスト ファイルを再生するパイプラインをセットアップすることもできます。
$ gst-launch-0.10 videotestsrc ! autovideosink
しかし、OGG デマルチプレクサからビデオ ストリームを再生するための適切なパイプラインをつなぎ合わせることができないようです。
gstreamer のドキュメント (図 3 - http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+3%3A+Dynamic+pipelines ) によると、OGG デマルチプレクサ ビデオ シンクは src_02 である必要があります。これは gst-inspect コマンドでサポートされているようです:
$ gst-inspect oggdemux
...
Pad Templates:
SRC template: 'src_%d'
Availability: Sometimes
Capabilities:
ANY
SINK template: 'sink'
Availability: Always
Capabilities:
application/ogg
application/x-annodex
...
パッドの指定に関するこのチュートリアル ( http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+10%3A+GStreamer+tools ) によると、ファイルからビデオ ストリームを再生するコマンドは、こんな風に見える:
$ gst-launch-0.10 filesrc location=demo.ogv ! oggdemux name=d d.src_02 ! theoradec ! autovideosink
しかし、これらは私の実行結果です。すべてが「プリローリング」でハングしているように見えます。コマンド ラインに戻るには、Ctrl+C で中断する必要があります。
$ gst-launch-0.10 filesrc location=demo.ogv ! oggdemux name=d d.src_02 ! theoradec ! autovideosink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
^C
Caught interrupt -- handling interrupt.
Interrupt: Stopping pipeline ...
(gst-launch-0.10:7625): GLib-CRITICAL **: Source ID 1 was not found when attempting to remove it
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...
何か案は?
また、潜在的に洞察力があります:
$ gst-typefind-0.10 demo.ogv
demo.ogv - application/x-annodex
$ gst-discoverer-0.10 demo.ogv
Analyzing file:///projects/keypr/demo.ogv
Done discovering file:///projects/keypr/demo.ogv
Topology:
container: Ogg
audio: Vorbis
video: Theora
Properties:
Duration: 0:00:05.546666666
Seekable: yes
Tags:
container format: Ogg
application name: ffmpeg2theora-0.26
extended comment: SOURCE_OSHASH=d1af78a82e61d18f
encoder: Xiph.Org libtheora 1.1 20090822 (Thusnelda)
encoder version: 0
nominal bitrate: 110000
bitrate: 110000
video codec: Theora
audio codec: Vorbis
更新:次のコマンドを使用して、オーディオストリームのみを再生できました。
$ gst-launch-0.10 uridecodebin uri=file:///path/to/demo.ogv ! audioconvert ! autoaudiosink
を使用した場合は動作しませんのでご注意くださいfilesrc location=demo.ogv
。uridecodebin を使用する場合のみ。そして、私はまだビデオ ストリームを分離できません。
更新 2: ビデオ ストリームを分離して再生するパイプラインを見つけましたが、理解できません。
$ gst-launch-0.10 uridecodebin uri=file:///path/to/demo.ogv ! theoraenc ! oggmux ! oggdemux ! theoradec ! ffmpegcolorspace ! videoscale ! ximagesink
サーフィン中に見つけて ( http://wiki.laptop.org/go/GStreamer/Developers )、videotestsrc のデモ実行を見ました。
$ gst-launch-0.10 videotestsrc ! theoraenc ! oggmux ! oggdemux ! theoradec ! ffmpegcolorspace ! videoscale ! ximagesink
なぜこれが機能するのか誰でも説明できますか? これは、ファイルをエンコード、多重化、逆多重化、デコードし、シンクにフィルター/スケーリングするように見えます。これはどのように理にかなっていますか?