WebRTC send audio/video with vp8 from RaspberryPi
Jan Schmidt
thaytan at noraisin.net
Sun Aug 9 08:52:34 PDT 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On 08/08/15 11:36, s0h0 wrote:
> Thank you for the help.
>
> Main issue was the audio for me, now it is working for me with
> audio and video. Looks like h264 is much simpler to use, and VP8
> wont have a good performance on RaspberryPi.
>
> I have a low badwidth of 1720kBit/s downstream and 400kBit/s
> upstream. I get a low of NACKS in Janus and gstream shows me an
> error after a while. Might the badwitdth the problem? Have you andy
> idea how to improve performance of the pipes?
mulawenc at 8khz, 8-bit is 64 kbit of bandwidth, plus overhead. With
100kbit/s for the video, you should have enough upstream bandwidth
(although I'd expect the video quality to be terrible. Maybe at 2fps,
it'll be OK)
Try adding a queue into the audio chain, between alsasrc and mulawenc.
That will decouple capture from transmission into 2 threads.
> New clock: GstSystemClock WARNING: from element
> /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: Can't record audio fast
> enough Additional debug info: gstaudiobasesrc.c(857):
> gst_audio_base_src_create ():
> /GstPipeline:pipeline0/GstAlsaSrc:alsasrc0: Dropped 4240 samples.
> This is most likely because downstream can't keep up and is
> consuming samples too slowly.
>
>
>
> This is how audio and video is working for me (video has a lot
> freezes and audio i can hear just fragments...) #!/bin/bash -e /
> gst-launch-1.0 -v alsasrc device=plughw:Set ! mulawenc ! rtppcmupay
> ! udpsink host=137.116.196.147 port=8003 &
>
> raspivid -n -w 640 -h 480 -b 100000 -fps 2 -vf -hf -t 0 -pf
> baseline -o - | gst-launch-1.0 -v fdsrc fd=0 ! h264parse !
> rtph264pay config-interval=2 pt=126 ! udpsink host=137.116.196.147
> port=8005/
As suggested elsewhere, switch to using gst-rpicamsrc instead of
raspivid + fdsrc. You'll get lower CPU usage by not copying everything
through a file descriptor, and less inter-frame jitter that way - not
that that probably matters at 2 fps.
You can put both audio and video into one gst-launch-1.0 line, so they
share a clock and should retain sync over long periods of time.
gst-launch-1.0 -v alsasrc device=plughw:Set ! queue ! mulawenc !
rtppcmupay ! udpsink host=137.116.196.147 port=8003 \
rpicamsrc bitrate=100000 hflip=true vflip=true preview=false !
video/x-h264,profile=baseline,width=640,height=480,framerate=2/1 !
h264parse ! rtph264pay config-interval=2 pt=126 ! udpsink
host=137.116.196.147 port=8005
should do it.
> raspivid -n -w 640 -h 480 -b 100000 -fps 2 -vf -hf -t 0 -pf
> baseline
- -o - |
> gst-launch-1.0 -v fdsrc fd=0 ! h264parse ! rtph264pay
config-interval=2 pt=126 ! udpsink host=137.116.196.147 port=8005
>
>
> Thank you!
>
>
>
> -- View this message in context:
> http://gstreamer-devel.966125.n4.nabble.com/WebRTC-send-audio-video-wi
th-vp8-from-RaspberryPi-tp4673026p4673059.html
>
>
Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________ gstreamer-devel
> mailing list gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCgAGBQJVx3c/AAoJEEqdx1eGJfOeRaMP/11nAW4GKJcHUUtBo1S0UcG6
PiQzE1BdsjlWifGxh8V1S9VGS//szpKvMDDq/ei2cb38pjzZ2WAbjPL3bK0Ay5m3
W7Mm41sFMv9bfoHro/0gquiS13dSuk02qKx96LozQ4y4HGVPNxI/nq0/g71h6+GL
xvYymfx4MCRJroqetG79GvAKp0zTMIIBSYdTFMu2L57W9BDGj9WKDhsvTc3n8i+S
Ex2z0ugXqniZKtOse82QLM+lxgEa5mZLrftySZMuwojuqyh30rzdEyReQZxCtoaw
CmvMJJydwaNoV26HPhJRiuoCd5qy0Ky2LWYdX4QskUgiWJX9gcbOmv94jwy1fa1u
G7NZo0dA4OxmM2ttJyNUgDxWS+qhk8wRZxTzP1h9+3qB75UMzOnM/TGRnBXbzWjn
A5JBriCBiRqIEmvoQiE3TftrfAfUFwmRf8SLIHmY6n7b5BFosa5JFeHSW+eIB51G
ms5bWBhiClCrl2yoSmf6QLy1NHoqwCjgEIRgWGth8Rz4JR3qOCPWl6u5aOHg8+JM
/OLHodHPlMbUI0dWJC7c5UoQNb00Q39sXe05CfRXMQl6hY/ccmLRMDFwSpZwTD2m
e79HdBuwIGLgKZfwztwCSATUgpnnnucwHKQ8e6lKy00iiVrmrUmsg0FlBUCqmXAH
YOke7vVrhY5NnwSRuUH8
=a4cW
-----END PGP SIGNATURE-----
More information about the gstreamer-devel
mailing list