Armadilloフォーラム

Armadillo840 Ether経由で受信した動画がGStreamerで再生されない

knoxuser

2014年9月17日 11時21分

現在、Raspberry Piで撮影した動画をEther経由でArmadillo840に送信し、
Armadillo840のモニタ(LCD)に表示させようとしておりますが
再生されずエラーが発生しております。
何か解決策はございますでしょうか?

実行手順:
(1)Armadillo840でgst-launch-1.0を実行して待ち受け
(2)Raspberry Piでraspividを実行して動画を撮影し、同時にNetcat(UDP)でArmadillo840に送信

補足:
Raspberry Piのコマンドはそのまま、Armadillo840のGStreamerをMPlayerに変更した場合、
正常に動画再生されることを確認しております。

エラー発生時のコマンドおよびターミナルに出力されるログを記載します。
 ※受信側のsinkはどこまでうまく繋がっているかを確認するためにfakesinkを使用しています。

 送信側…送信側(Raspberry Pi)で実行したコマンド
 受信側…受信側(Armadillo840)で実行したコマンドと出力されたログ(デバッグレベルは2)

送信側

pi@raspberrypi ~ $ raspivid -o - -t 0 -w 320 -h 240 -n | nc -u 10.130.1.91 5001

受信側

[root@armadillo840-0 (ttySC2) ~]# GST_DEBUG=2 gst-launch-1.0 -v udpsrc port=5001 caps="video/x-h264,stream-format=avc,alignment=au,height=240,width=320,framerate=25/1" ! h264parse ! queue ! acmh264dec ! fakesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstUDPSrc:udpsrc0.GstPad:src: caps = video/x-h264, height=(int)240, width=(int)320, framerate=(fraction)25/1, stream-format=(string)avc, alignment=(string)au
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:src: caps = video/x-h264, height=(int)240, width=(int)320, framerate=(fraction)25/1, stream-format=(string)avc, alignment=(string)au, parsed=(boolean)true
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-h264, height=(int)240, width=(int)320, framerate=(fraction)25/1, stream-format=(string)avc, alignment=(string)au, parsed=(boolean)true
/GstPipeline:pipeline0/GstH264Parse:h264parse0.GstPad:sink: caps = video/x-h264, height=(int)240, width=(int)320, framerate=(fraction)25/1, stream-format=(string)avc, alignment=(string)au
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = video/x-h264, height=(int)240, width=(int)320, framerate=(fraction)25/1, stream-format=(string)avc, alignment=(string)au, parsed=(boolean)true
/GstPipeline:pipeline0/GstAcmH264Dec:acmh264dec0.GstPad:sink: caps = video/x-h264, height=(int)240, width=(int)320, framerate=(fraction)25/1, stream-format=(string)avc, alignment=(string)au, parsed=(boolean)true
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:06.110656273 12023    0xea430 WARN              acmh264dec gstacmh264dec.c:1002:gst_acm_h264_dec_set_format:<acmh264dec0> refused screen info query from peer src pad
/GstPipeline:pipeline0/GstAcmH264Dec:acmh264dec0.GstPad:src: caps = video/x-raw, format=(string)RGB16, width=(int)320, height=(int)240, pixel-aspeacm_h264dec: Failed to send decode message
ct-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0, framerate=(fraction)25/1, stride=(int)320, x-offset=(int)0, y-offset=(int)0
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-raw, format=(string)RGB16, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0, framerate=(fraction)25/1, stride=(int)320, x-offset=(int)0, y-offset=(int)0
0:00:06.120334456 12023    0xea430 WARN              acmh264dec gstacmh264dec.c:1105:gst_acm_h264_dec_set_format:<acmh264dec0> refused dma buf query from peer src pad
0:00:16.156787599 12023    0xea430 ERROR             acmh264dec gstacmh264dec.c:1753:gst_acm_h264_dec_handle_frame:<acmh264dec0> select() for input is timeout
0:00:16.156998353 12023    0xea430 ERROR             acmh264dec gstacmh264dec.c:1802:gst_acm_h264_dec_handle_frame:<acmh264dec0> pool_out - buffers:3, allocated:3, queued:3
0:00:16.157121605 12023    0xea430 WARN              acmh264dec gstacmh264dec.c:1809:gst_acm_h264_dec_handle_frame:<acmh264dec0> error: timeout with select()
ERROR: from element /GstPipeline:pipeline0/GstAcmH264Dec:acmh264dec0: Could not decode stream.
Additional debug info:
gstacmh264dec.c(1809): gst_acm_h264_dec_handle_frame (): /GstPipeline:pipeline0/GstAcmH264Dec:acmh264dec0:
timeout with select()
Execution ended after 15915267620 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
0:00:16.159127061 12023    0x1ee90 WARN                 basesrc gstbasesrc.c:2812:gst_base_src_loop:<udpsrc0> error: Internal data flow error.
0:00:16.159276064 12023    0x1ee90 WARN                 basesrc gstbasesrc.c:2812:gst_base_src_loop:<udpsrc0> error: streaming task paused, reason error (-5)
Setting pipeline to NULL ...
Freeing pipeline ...
コメント

at_makoto.harada

2014年9月18日 22時06分

原田です。

stream-formatをbyte-streamにして、試してみてもらえますか?
私の環境では、以下のように試して動作しました。

[PC]$ cat /tmp/h264.data | nc -u 172.16.2.34 5000
[Armadillo-840]$ gst-launch-1.0 -v udpsrc port=5000 caps=video/x-h264,stream-format=byte-stream,alignment=au,height=800,width=480,framerate=25/1
'!' h264parse '!' queue '!' acmh264dec '!' acmfbdevsink device=/dev/fb1'

knoxuser

2014年9月19日 13時52分

原田様

お忙しいところご回答頂きありがとうございます。
こちらの環境で試してみます。

knoxuser

2014年9月19日 16時34分

原田様

stream-formatをbyte-streamにして、試したところ正常に表示されることが確認できました。
有り難うございました。

また、質問なのですが
2つのカメラから同時に動画を受信し、GStreamerで再生する(画面を半分に分けてそれぞれ表示する)
ことは可能でしょうか?
ご存知でしたらご教示いただけないでしょうか。

at_makoto.harada

2014年9月22日 17時46分

> 2つのカメラから同時に動画を受信し、GStreamerで再生する(画面を半分に分けてそれぞ
> れ表示する)
> ことは可能でしょうか?
> ご存知でしたらご教示いただけないでしょうか。

頂いたご質問を分割し以下の3つの要件に分けてみました。

1. 2つのカメラから同時に動画を受信
2. 2つの動画を同時にデコード
3. 画面を半分に分けて2画面表示

1はインターフェースが異なってさえいれば(USBとEthernetを用いる、Ethernetで異な
るポートを用いる等)実現可能です。

2に関しては、動画フォーマットはいずれもH.264でしょうか?
Armadiilo-840にて採用したR-mobile A1に搭載されているH.264のHWデコーダエンジンは1
つで、同時に2つの動画のデコードには対応しておりません。その場合は、SWデコーダ
(avdec_h264等)を併用する必要があります。
(R-mobile A1はCortex A9シングルコアプロセッサなので、SWデコーダを用いた場合、動画の
解像度やフレームレートによっては所望のパフォーマンスが出ない可能性があります。)

3に関してはsinkエレメントにデータを書き込む前に、2つの画像を1つにまとめる必要が
あるかと思います。Armadiiloで試せていないのですが、videomixer pluginが使えるかも
しれません。
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-go…

"gstreamer combine 2 videos"あたりで検索してみると情報がでてきますね。
色々試してみてください。

原田

knoxuser

2014年9月22日 18時08分

原田様

お忙しいところご回答頂きありがとうございます。
再生方法について色々試してみます。