I have a fisheye usb webcam attached to a raspberry pi that I'm trying to stream to a computer. I've played with ffmpeg and it seems a little laggy beyond 320x240. From what I've read people have been happy with gstreamer.
So I've tested the usb webcam and it works locally
gst-launch-1.0 -v v4l2src device=/dev/video0 ! 'video/x-raw,width=640,height=480' ! glimagesink
These are the commands I've been trying to use to get the video to my computer. However, all I'm seeing is a green window.
TCP Sever:gst-launch-1.0 -v v4l2src device=/dev/video0 ! 'video/x-raw,width=640,height=480,framerate=30/1' ! x264enc byte-stream=true ! rtph264pay ! gdppay ! tcpserversink host=192.168.200.38 port=5000 sync=false
TCP Client: gst-launch-1.0 -v tcpclientsrc host=192.168.200.38 port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false
or
UDP Server:
gst-launch-1.0 -v v4l2src device=/dev/video0 ! 'video/x-raw,width=640,height=480,framerate=30/1' ! x264enc byte-stream=true ! rtph264pay ! gdppay ! udpsink host=192.168.200.37 port=5000 sync=false
UDP Client:
gst-launch-1.0 -v udpsrc port=5000 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink sync=false
I figure I must be piping the plugins wrong somehow. Any advice is appreciated.
So I've twiddled things for a day and got it working. I'll post what I have so far. The queue lets the rpi multi-thread the h264 encoding portion and I've sub-ed omxh264enc for x264enc because it is openmax/accelerated. Both changes help latency.
I guess I didn't need gdppay? (saw someone stream without it here Stream webcam video with gstreamer 1.0 over UDP to PC)
rpi side
gst-launch-1.0 -vv -e v4l2src device=/dev/video0 ! "video/x-raw,width=640,height=480" ! queue ! omxh264enc ! h264parse ! rtph264pay ! udpsink host=192.168.200.37 port=5000
computer side
gst-launch-1.0 -vv -e udpsrc port=5000 ! application/x-rtp, payload=96 ! rtph264depay ! queue ! avdec_h264 ! videoconvert ! autovideosink sync=false