Video streaming with v4l2 and gstreamer not working

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Video streaming with v4l2 and gstreamer not working

10,754 Views
mreichh
Contributor I

Hello,

I have trouble getting video streaming running on my i.M8m EVK board.

Image used: fsl-image-qt5-validation-imx (Kernel 4.9.123)

I tested functionality using following command (which is working on another prebuilt image I have):

gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480 ! waylandsink

=>

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../../../../git/libs/gst/base/gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.000819504
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Having a look at:

v4l2-ctl --all

=>

Driver Info (not using libv4l2):
Driver name : mx6s-csi
Card type : i.MX6S_CSI
Bus info : platform:30a90000.csi1_bridge
Driver version: 4.9.123
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 0
Video input : 0 (Camera: ok)
Format Video Capture:
Width/Height : 0/0
Pixel Format : ''
Field : Any
Bytes per Line : 0
Size Image : 0
Colorspace : Default
Transfer Function : Default
YCbCr/HSV Encoding: Default
Quantization : Default
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 0, Height 0
Default : Left 0, Top 0, Width 0, Height 0
Pixel Aspect: 1/1
Crop: Left 0, Top 0, Width 0, Height 0

compared to the prebuilt image I have the following lines are missing:

Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 30.000 (30/1)
Read buffers : 0

I expect at least part of the problem are some "IMAGE_INSTALL_append" entries missing in my local.conf.

I would be thankful for any advice.

Labels (1)
0 Kudos
6 Replies

7,168 Views
mreichh
Contributor I

Hello Igor,

thanks for your answer. I would prefer not having to switch back to 4.14.78. Are you sure my problem would be used by switching back and building the same image ( fsl-image-qt5-validation-imx) there?

Your suggested playback command throws following error:

WARNING: erroneous pipeline: no property "enable-tile" in element "waylandsink0"

Regards

Martin

0 Kudos

7,168 Views
igorpadykov
NXP Employee
NXP Employee

Hi Martin

yes Kernel 4.9.123 may not work properly with i.MX8M, L4.14.78

has many improvements..

Best regards
igor

0 Kudos

7,168 Views
mreichh
Contributor I

Hello Igor

thanks for the advice  I updated to L4.14.78. It fixed some other issues I had but I still face the same problem regarding video streaming.

root@imx8mqevk:~# ./stream.sh
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../../../../git/libs/gst/base/gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.000369366
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

using: v4l2-ctl --all I still miss :

compared to the prebuilt image I have the following lines are missing:

Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 30.000 (30/1)
Read buffers : 0

Any ideas?

0 Kudos

7,168 Views
gaurangk
Contributor I

Hi Martin,

I am facing the same issue with iMX8M. Did you get any solutions for it?

0 Kudos

7,168 Views
igorpadykov
NXP Employee
NXP Employee

one can try with some examples:

gst-launch-1.0 -v udpsrc ! application/x-rtp ! rtpjitterbuffer ! rtph264depay !  queue ! vpudec ! queue ! kmssink
gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=30/1 ! queue ! v4l2h264enc ! queue ! v4l2h264dec ! waylandsink
gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,width=640,height=480,framerate=30/1 ! queue ! v4l2h264enc ! queue ! v4l2h264dec ! waylandsink

Best regards
igor

0 Kudos

7,168 Views
igorpadykov
NXP Employee
NXP Employee

Hi Martin

for i.MX8M recommended to use Linux L4.14.78 Linux Binary Demo Files - i.MX 8MQuad EVK

as Kernel 4.9.123 was tested only with i.MX8MMini.

example camera 2 playback:

gst-launch-1.0 v4l2src ! video/x-raw,format=YUY2,width=1920,height=1080 ! queue max-size-time=0 ! waylandsink enable-tile=true sync=false

other useful links:

DART-MX8M Yocto - Variscite Wiki 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos