Question on streaming
Tim Müller
tim at centricular.com
Mon Mar 27 17:18:56 UTC 2017
On Mon, 2017-03-27 at 11:35 -0400, Jerry Geis wrote:
Hi Jerry,
> I am using this command on my server:
>
> gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! video/x-
> raw,width=1920,height=1080 ! videoconvert ! vp8enc cpu-used=16 end-
> usage=vbr target-bitrate=1024000 token-partitions=3 static-
> threshold=1000 min-quantizer=0 max-quantizer=63 threads=2 ! rtpvp8pay
> ! udpsink host=192.168.101.186 port=5000
Have you considered using RTSP instead of 'raw' UDP/RTP?
The data transport would/could still be done with UDP, but there would
be an additional session setup which simplifies many things.
If that's something you might be interested in, check out gst-rtsp-
server and try e.g.:
gst-rtsp-server/examples$ ./test-launch 'v4l2src device=/dev/video0 !
videoconvert ! vp8enc cpu-used=16 end-usage=vbr target-bitrate=1024000
token-partitions=3 static-threshold=1000 min-quantizer=0 max-
quantizer=63 threads=2 deadline=1 ! rtpvp8pay name=pay0'
Note that I added a deadline=1 parameter to vp8enc here. I dropped your
resolution caps filter, but you can add it back of course.
Once that runs you can do:
vlc rtsp://127.0.0.1:8554/test
or
totem rtsp://127.0.0.1:8554/test
or
gst-play-1.0 rtsp://127.0.0.1:8554/test
or
gst-launch-1.0 playbin uri=rtsp://127.0.0.1:8554/test \
uridecodebin0::source::latency=100
(By default GStreamer uses a default jitterbuffer latency/size of
2000ms, which is quite large, so the last example shows you how you can
use a smaller value with gst-launch-1.0 - this is all completely client
side.)
If you add a
gst_rtsp_media_factory_set_shared (factory, TRUE);
to test-launch.c and recompile with 'make' the capture/encode pipeline
can be shared amongst as many clients as you like.
I realise this doesn't quite answer your question, but it's still what
I'd recommend if you don't have any reason not to go this way :)
Cheers
-Tim
> Which leaves me with two questions:
>
> 1) What is the command to "view" the streaming out on clients?
>
> 2) How many clients can connect and view the stream at one time.
>
--
Tim Müller, Centricular Ltd - http://www.centricular.com
More information about the gstreamer-devel
mailing list