Video Guestbook with Gstreamer on Rpi

mathieu gosselin murlock7 at yahoo.fr
Mon May 25 11:57:27 PDT 2015


Hello,

Thanks for all your answers but I will need a little more help :
I can't find anywhere a simple explanation to install Gstreamer 1.4 on a rasperry pi, anyone can explain me how to do this?

the uvch264src that you talking about seems interesting if I can use the preview stream on the screen and the encoded H264 stream for the file :
I tried the following command line (inspired from here :http://www.oz9aec.net/index.php/gstreamer/487-using-the-logitech-c920-webcam-with-gstreamer-12 ):

gst-launch-1.0 -v -e uvch264src device=/dev/video0 name=src auto-start=true \ src.vfsrc ! queue ! video/x-raw,format=\(string\)YUY2,width=320,height=240,framerate=10/1 ! autovideosink sync=false \ src.vidsrc ! queue ! video/x-h264,width=1280,height=720,framerate=30/1 ! h264parse ! avdec_h264 ! filesink location=muxed-long.mp4 

but I get the following error :
Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstUvcH264Src:src/GstV4l2Src:v4l2src0: num-buffers = -1
/GstPipeline:pipeline0/GstUvcH264Src:src/GstV4l2Src:v4l2src0: device = /dev/video0
/GstPipeline:pipeline0/GstUvcH264Src:src/GstV4l2Src:v4l2src0: num-buffers = -1
/GstPipeline:pipeline0/GstUvcH264Src:src/GstV4l2Src:v4l2src0: device = /dev/video0
/GstPipeline:pipeline0/GstUvcH264Src:src/GstCapsFilter:capsfilter2: caps = EMPTY
ERROR: Pipeline doesn't want to pause.
Setting pipeline to NULL ...
Freeing pipeline ...


should I use the  "do-timestamp=1" with uvch264src too?

and for the sound how the faac element works and how to include it in the command line ? 

Thanks for your help!


--------------------------------------------
En date de : Sam 23.5.15, Nicolas Dufresne <nicolas.dufresne at collabora.com> a écrit :

 Objet: Re: Video Guestbook with Gstreamer on Rpi
 À: "Discussion of the development of and with GStreamer" <gstreamer-devel at lists.freedesktop.org>
 Date: Samedi 23 mai 2015, 16h58
 
 Le samedi 23 mai 2015 à 11:51 +0100,
 mathieu gosselin a écrit :
 > Hello,
 > 
 > I m a newbie with gstreamer and I try to use it on a
 raspberry with a 
 > webcam Logitech C920. This is a project guestbook
 video: the goal is 
 > to record with the camera in a file (in good quality
 and with sound) 
 > and, in parallel, display just the image on a screen.
 
 Note that there is a firmware bug in this camera that cause
 the
 timestamp to be wrong. You may need to enable do-timestamp=1
 on the
 source (v4l2src) (or use development version of GStreamer).
 
 > 
 > For now I managed to get the video on the screen but
 very jerky and 
 > not very clear unless I drop the resolution with the
 command line:
 > gst-launch-1.0 -e v4l2src device=/dev/video0 !
 video/x-h264, 
 > width=320, height=240, framerate=15/1 ! avdec_h264 !
 eglglessink 
 > sync=false
 
 The fact you use sync=false is most likely because of the
 above. The
 main issue here though is that you have chosen a software
 decoder. The
 Rapsberry Pi have a very small CPU. You should use the HW
 decoder
 instead. For simplicity, just use decodebin, it will pick
 the right
 decoder for you.
 
 Also note that the C920 can also be used with uvch264src
 element, which
 will enable more features. It can providing you with two
 stream, a raw
 preview and an encoded H264 stream. It also let you choose
 the stream
 quality and bitrate.
 
 > 
 > 
 > I also managed to generate a record in a file (oddly
 the video seems 
 > a little accelerated) but without sound, with this
 command:
 > gst-launch-1.0 -e v4l2src device=/dev/video0 !
 video/x-h264, 
 > width=800,height=600,framerate=30/1 ! queue ! avimux !
 filesink 
 > location=yop.avi
 
 The speed issue could be a bug in avimux, or simply that AVI
 does not
 tolerate variable framerate (the C920 does that by default).
 Note that
 AVI is rarely used these days, hence may have less testing.
 
 > 
 > in fact impossible to operate the sound I tried with
 this command 
 > that I found on the net done by a guy with the same
 webcam. But it 
 > does not recognize "voaacenc"
 > gst-launch-1.0 v4l2src device=/dev/video0 ! video/x
 > -h264,width=1280,height=720,framerate=30/1 ! h264parse
 ! muxout. 
 > pulsesrc
 device="alsa_input.usb-046d_HD_Pro_Webcam_C920_696E9EDF-02
 > -C920.analog-stereo" ! queue ! audioconvert ! voaacenc
 bitrate=65536 
 > ! muxout. matroskamux name=muxout streamable=true !
 filesink 
 > location=muxed-long.mp4
 
 This is element is likely introduced in GStreamer 1.4, you
 seem to be
 using GStreamer 1.2. It is possible that you could use faac
 element
 instead. Notice that you save a Matroska stream into a file
 name .mp4,
 this can be confusing. Extension .mkv is usually expected.
 
 Nicolas
 
 _______________________________________________
 gstreamer-devel mailing list
 gstreamer-devel at lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
 


More information about the gstreamer-devel mailing list