Accessing raw data from v4lsrc

classic Classic list List threaded Threaded
3 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
Reply | Threaded
Open this post in threaded view
|

Re: Accessing raw data from v4lsrc

Aditya Oza
As you mention I create one pipeline.

I used raspberry pi 3b+ camera for streaming and recording .

My goal Is I want  raw data.

I used following pipeline :
 
gst-launch-1.0 --gst-debug-level=3 -e v4l2src device=/dev/video0 !
videoconvert ! video/x-raw,width=640,height=480,framerate=30/1 ! tee
name=tee0 ! queue ! omxh264enc ! h264parse ! mp4mux ! filesink
location=raw2.mp4 tee0. ! queue ! appsink

After run this pipeline I did not get proper data.. Just create 4kb mp4
file. when I try to play a file(4 kb)they could not be open.


Please suggest me when I am wrong?
 
suggest me a better way to get raw data from my camera.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel