Accessing raw data from v4lsrc

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Accessing raw data from v4lsrc

simo-zz
Hello,
I need to generate a video from a USB webcam and, at the same time, access to the non encoded raw data of the webcam.
The following pipe works for me to record a video:

gst-launch-1.0 -e v4l2src device=/dev/webcam ! videoconvert ! video/x-raw,width=544,height=288,framerate=10/1 ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=video.mp4

But how do I get the raw data from webcam with gstreamer ?
Thank you.
Simon

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Accessing raw data from v4lsrc

Martin Vachovski

Hi Simon,


You can do something like:


gst-launch-1.0 -e v4l2src device=/dev/webcam ! videoconvert ! video/x-raw,width=544,height=288,framerate=10/1 ! tee name=tee0 ! queue ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=video.mp4 tee0. ! queue ! appsink


Note

1) the use of the "tee" element to split the pipeline in two branches

2) appsink will let you get data out of the pipeline as a (gchar *) C-array every time a new frame arrives (see the "new-sample" signal)


Hope that helps

​Martin




From: gstreamer-devel <[hidden email]> on behalf of simo zz <[hidden email]>
Sent: Thursday, September 7, 2017 10:26 AM
To: Discussion of the Development of and With GStreamer
Subject: Accessing raw data from v4lsrc
 
Hello,
I need to generate a video from a USB webcam and, at the same time, access to the non encoded raw data of the webcam.
The following pipe works for me to record a video:

gst-launch-1.0 -e v4l2src device=/dev/webcam ! videoconvert ! video/x-raw,width=544,height=288,framerate=10/1 ! v4l2h264enc ! h264parse ! mp4mux ! filesink location=video.mp4

But how do I get the raw data from webcam with gstreamer ?
Thank you.
Simon

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel