MP3のタグ情報取得に続き、
http://blog.suz-lab.com/2010/03/gstreamermp3.html
今度は動画も試してみました。
MP4はこんな感じでです。
# gst-launch filesrc location=input.mp4 ! decodebin ! fakesink -t
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
FOUND TAG : found by element "qtdemux0".
video codec: H.264 / AVC
FOUND TAG : found by element "qtdemux0".
audio codec: MPEG-4 AAC audio
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 724906045 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
FREEING pipeline ...
調子に乗って、MTSも試してみましたが、
# gst-launch filesrc location=input.mts ! decodebin ! fakesink -t
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /pipeline0/decodebin0: A MPEG-2 Transport Stream
demuxer plugin is required to play this stream, but not installed.
Additional debug info:
gstdecodebin.c(845): close_pad_link (): /pipeline0/decodebin0:
No decoder to handle media type 'video/mpegts'
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
FREEING pipeline ...
こちらはエラーになってしまいました。
しかし、下記でインストールしたことを思いだし、
# yum install gstreamer-ffmpeg
以下のFFmpeg関連のドキュメントを見ながら試行錯誤したところ、
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-ffmpeg-plugins/html/
以下のように、MTSも成功しました。
# gst-launch filesrc location=input.mts ! ffdemux_mpegts ! fakesink -t
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
FOUND TAG : found by element "ffdemux_mpegts0".
video codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
FOUND TAG : found by element "ffdemux_mpegts0".
audio codec: ATSC A/52A (AC-3)
FOUND TAG : found by element "ffdemux_mpegts0".
audio codec: ATSC A/52A (AC-3)
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Got EOS from element "pipeline0".
Execution ended after 77135625 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
FREEING pipeline ...
そんなこんなで、GStreamerの感触はつかめてきた感じです。
本命はGStreamer使ったPerlでの音合成なんだけど...
--------
http://www.suz-lab.com

2 コメント:
情報取得なら最近のFFmpegに含まれるffprobeの-show_formatや-show_streamsの方が良いと思います。
おおー、そんなのあるんですねー。
こちらでも試してみます。
情報、ありがとうございます。
コメントを投稿