This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software: Linux
Hello,
We are trying to capture jpeg image continuously from our imager.
We can capture jpeg image from vpe using below command. (Image size which is given by imager is 1280x720)
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=5/1' ! vpe ! 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=5/1' ! filesink location=IMAGE.jpeg
So we have question related to VPE.
Can we capture image/jpeg from v4l2src without using VPE?
We are trying to do with below pipeline But we are getting error, and we check in gst-inspec v4l2src supports image/jpeg .
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 io-mode=4 ! 'image/jpeg, width=(int)640, height=(int)720, framerate=5/1' ! filesink location=IMAGE.jpeg
============================================================================================================================
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
../../../../gstreamer-1.2.3/libs/gst/base/gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.006865408
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
===========================================================================================================================
Please do the needful.
Regards,
-- Ronak
Hello,
Streaming task paused, reason not-negotiated (-4) most of the cases means the video format you get from your video source is not compatible with the sink.
Most of the video source provide on the output YUV data. Since I know there are video sources that provide jpeg enc data.
What your video source provides?
I would recommend you to add --gst-debug=v4l2src:4/--gst-debug=v4l2src:5 to your pipeline and check the log.
BR
Margarita
Hello,
In additional, it seems like your video source provides raw yuy2 format.
Ronak Patel said:gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=5/1' ! vpe ! 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=5/1' ! filesink location=IMAGE.jpeg
The file IMAGE.jpeg is raw yuy2.
For jpeg you could use jpegenc.
BR
Margarita
Hello,
Thank You for your quick reply.
Yes you are right, we have imager which is giving jpeg enc data.
So on AM5728 how can we receive the jpeg encoded data by using v4l2src.
we are trying below pipeline
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 io-mode=4 ! 'image/jpeg, width=(int)640, height=(int)720, framerate=5/1' ! filesink location=IMAGE.jpeg
It doesn't work, Can you please suggest the pipeline?
Regards,
-- Ronak
Hello,
Is this pipeline working?
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw, format=(string)YUY2, width=(int)640, height=(int)720, framerate=5/1' ! filesink location=IMAGE.jpeg
BR
Margarita
Hello,
Tried without (dmabuf) io-mode=4 for both pipeline, and below is the result
WORKING (with video/x-raw)
1).gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw, width=(int)640, height=(int)720, framerate=5/1' ! filesink location=IMAGE.jpeg
NOT WORKING(with image/jpeg)
2). gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'image/jpeg, width=(int)640, height=(int)720, framerate=5/1' ! filesink location=IMAGE.jpeg
------------------------------------------------------------------------------------------------------------ LOGS -----------------------------------------------------------------------------------------------------------
0:00:02.589227969 1733 0x11e630 DEBUG v4l2src ../../../gst-plugins-good-1.2.3/sys/v4l2/gstv4l2src.c:321:gst_v4l2src_negotiate:<v4l2src0> caps of peer: image/jpeg, width=(int)640, height=(int)720, framerate=(fraction)5/1
0:00:02.589306863 1733 0x11e630 DEBUG v4l2src ../../../gst-plugins-good-1.2.3/sys/v4l2/gstv4l2src.c:322:gst_v4l2src_negotiate:<v4l2src0> peercaps: image/jpeg, width=(int)640, height=(int)720, framerate=(fraction)5/1
0:00:02.946262344 1733 0x11e630 DEBUG v4l2src ../../../gst-plugins-good-1.2.3/sys/v4l2/gstv4l2src.c:332:gst_v4l2src_negotiate:<v4l2src0> peer: image/jpeg, width=(int)640, height=(int)720, framerate=(fraction)5/1
0:00:02.946328062 1733 0x11e630 DEBUG v4l2src ../../../gst-plugins-good-1.2.3/sys/v4l2/gstv4l2src.c:333:gst_v4l2src_negotiate:<v4l2src0> ipcaps: image/jpeg, width=(int)640, height=(int)720, framerate=(fraction)5/1
0:00:02.946401913 1733 0x11e630 DEBUG v4l2src ../../../gst-plugins-good-1.2.3/sys/v4l2/gstv4l2src.c:345:gst_v4l2src_negotiate:<v4l2src0> intersect: (NULL)
0:00:02.946435423 1733 0x11e630 DEBUG v4l2src ../../../gst-plugins-good-1.2.3/sys/v4l2/gstv4l2src.c:346:gst_v4l2src_negotiate:<v4l2src0> icaps: (NULL)
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
../../../../gstreamer-1.2.3/libs/gst/base/gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:02.860037343
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
We need to capture JPEG enc data from imager, decode that and stream.
Regards,
-- Ronak
Hello,
Ronak Patel said:Yes, both the pipelines are using same video source.
So your video source could output RAW YUY2 and compressed jpeg ?
Thank for the log
BR
Margarita