3

ある PC から別の PC に Web カメラを IP 経由でストリーミングしようとしています。これはすべてコマンド ラインから行います。最初に試します:

# gst-launch v4l2src ! xvimagesink

これは正常に動作し、ウェブカメラを起動して画像/ビデオを表示します。次に、udp 経由で Web カメラを別の PC にストリーミングしようとします。

gst-launch v4l2src device=/dev/video0 ! 'video/x-raw-yuv,width=320,height=240' !  x264enc pass=qual quantizer=20 tune=zerolatency ! rtph264pay ! udpsink host=127.0.0.1 port=1234 sync=false

宛先の PC で、これを開始します。

gst-launch -v udpsrc port=1234 ! fakesink dump=1

シェルのどこに表示されますか:

00000000 (0x7f2ebc004a70): 80 e0 18 2b 7a 74 25 94 2b 28 22 2d 5c 41 73 0c  ...+zt%.+("-\As.
00000010 (0x7f2ebc004a80): a5 12 72 91 4b 97 36 f6 8f 12 46 d9 45 5f cf ac  ..r.K.6...F.E_..
00000020 (0x7f2ebc004a90): 92 80 33 35 c2 65 37 d5 f0 1e f0 70 d6 95 b2 3d  ..35.e7....p...=
00000030 (0x7f2ebc004aa0): 52 82 53 f7 fe 47 be 62 30 39 e9 97 c9 bb 56 de  R.S..G.b09....V.
00000040 (0x7f2ebc004ab0): b1 d3 eb d0 f1 49 90 7b bc 23 9b 9f ab 1e ee 72  .....I.{.#.....r
00000050 (0x7f2ebc004ac0): ff 61 41 ac 8e 54 b9 96 16 ba 4d 37 f6 67 8e ce  .aA..T....M7.g..
00000060 (0x7f2ebc004ad0): 1a 8b 6b 9a 06 f0 31 51 25 e2 b0 a6 73 55 23 76  ..k...1Q%...sU#v
00000070 (0x7f2ebc004ae0): 02 e8 97 60 ec 77 52 1d 3d 1c 55 52 5c 24 5a fb  ...`.wR.=.UR\$Z.
00000080 (0x7f2ebc004af0): ae 6f d7 bb 0a 18 bf bb 72 43 7e c2 76 ab fc ca  .o......rC~.v...
00000090 (0x7f2ebc004b00): ba dd a0 e5 f5 ea 61 2b 1c 77 da ab 44 62 4f 60  ......a+.w..DbO`
000000a0 (0x7f2ebc004b10): 78 83 d3 1a 54 f7 a9 af 15 4b db 08 6d 43 31 a5  x...T....K..mC1.

そのため、画像のストリーミングが機能しているように思えます。では、画面に表示してみます。これでストリームを表示します:

gst-launch -v udpsrc port=1234 ! application/x-rtp,clockrate=90000,payload=96 ! rtph264depay queue-delay=0 ! ffdec_h264 ! xvimagesink

ただし、Web カメラは表示されません。代わりに、シェルで次のように取得します。

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = application/x-rtp, clockrate=(int)90000, payload=(int)96, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:src: caps = video/x-h264
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:sink: caps = application/x-rtp, clockrate=(int)90000, payload=(int)96, media=(string)video, clock-rate=(int)90000, encoding-name=(string)H264
/GstPipeline:pipeline0/ffdec_h264:ffdec_h2640.GstPad:sink: caps = video/x-h264
/GstPipeline:pipeline0/ffdec_h264:ffdec_h2640.GstPad:src: caps = video/x-raw-yuv, width=(int)320, height=(int)240, framerate=(fraction)30/1, format=(fourcc)I420, interlaced=(boolean)false, pixel-aspect-ratio=(fraction)1/1
ERROR: from element /GstPipeline:pipeline0/GstUDPSrc:udpsrc0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2543): gst_base_src_loop (): /GstPipeline:pipeline0/GstUDPSrc:udpsrc0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 79200858888 ns.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
/GstPipeline:pipeline0/ffdec_h264:ffdec_h2640.GstPad:src: caps = NULL
/GstPipeline:pipeline0/ffdec_h264:ffdec_h2640.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstRtpH264Depay:rtph264depay0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = NULL
Setting pipeline to NULL ...
Freeing pipeline ...

何が間違っているのかわかりません。これはすべて CentOS 6.3 上にあり、リポジトリhttp://pkgrepo.linuxtech.net/el6/release/linuxtechからすべてのプラグイン (base、good、bad、ug) と gstreamer-ffmpeg を含む GStreamer 10.29 をインストールしました。レポ

4

1 に答える 1

3

まだ見ていない場合は、既製の送信者/受信者の例をここで見つけることができます。

http://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/rtp?h=0.10

于 2012-11-23T13:40:10.060 に答える