Webcam streaming using gstreamer over UDP

依然范特西╮ 提交于 2019-11-27 01:02:48

问题


Here is what I'm trying:

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

I test with:

gst-launch -v audiotestsrc ! udpsink host=127.0.0.1 port=1234

And everything works fine, I can see the packages arriving from the audiotestsrc

Now lets test with the webcam source:

gst-launch -v v4l2src device=/dev/video0 ! queue ! videoscale method=1 ! "video/x-raw-yuv,width=320,height=240" ! queue ! videorate ! "video/x-raw-yuv,framerate=(fraction)15/1" ! queue ! udpsink host=127.0.0.1 port=1234

And nothing happens, no package appears in the dump.

Here is a logdump of what verbose shows in the server.

Does anyone have a clue on this?


回答1:


Try these (You may have to install gstreamer-ugly plugins for this one)

UDP streaming from Webcam (stream over the network)

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

UDP Streaming received from webcam (receive over the network)

gst-launch udpsrc port=1234 ! "application/x-rtp, payload=127" ! rtph264depay ! ffdec_h264 ! xvimagesink sync=false

Update

To determine the payload at the streaming end simply use verbose option with gst-launch -v ...




回答2:


Maybe packets are too large for udp? They are limited to 64K. Try resizing frames to really small size to check if this is the reason. If so, you may be interested in some compression and payloaders/depayloaders (gst-inspect | grep pay).



来源:https://stackoverflow.com/questions/7669240/webcam-streaming-using-gstreamer-over-udp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!