PI_newbee
Posts: 172
Joined: Mon Aug 26, 2013 7:41 pm

ERROR: pipeline could not be constructed: no element "v4l2sr

Thu Aug 18, 2016 10:10 am

Hi.
I'm running one gstreamer code as shell script.
I installed all of necessary packages but after i run the code i get the error in subject.

This is the shell script code:
gst-launch -v v4l2src ! "image/jpeg,width=320,height=240,framerate=30/1" ! multipartmux !
tcpserversink host=x.x.x.x port=5000 sync=false alsasrc device=hw:1 ! audioconvert !
audioresample ! 'audio/x-raw-int,rate=8000,width=16,channels=1' ! udpsink host=x.x.x.x port=5001

Any ideas ?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9069
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: ERROR: pipeline could not be constructed: no element "v4

Thu Aug 18, 2016 10:20 am

You don't say which version of GStreamer you are using, but you're probably missing the plugins-good package
sudo apt-get install gst-plugins-good1.0
or
sudo apt-get install gst-plugins-good0.10
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

PI_newbee
Posts: 172
Joined: Mon Aug 26, 2013 7:41 pm

Re: ERROR: pipeline could not be constructed: no element "v4

Fri Aug 19, 2016 9:58 am

I reinstalled all the packages and it look like that the problem is solved.
But now when i run the script i get this:

./startScript.sh
----------------------------------------
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate format
Additional debug info:
gstbasesrc.c(2830): gst_base_src_start (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Check your filtered caps, if any
Setting pipeline to NULL ...
Freeing pipeline ...
----------------------------------------
Does this means that the gsteamer didnt exit correctly and the pipeline is still active / paused ?

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9069
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: ERROR: pipeline could not be constructed: no element "v4

Fri Aug 19, 2016 10:25 am

PI_newbee wrote:Setting pipeline to NULL ...
Freeing pipeline ...
----------------------------------------
Does this means that the gsteamer didnt exit correctly and the pipeline is still active / paused ?
Those last 2 lines mean that GStreamer has torn everything down.
PI_newbee wrote:ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could not negotiate format
So v4l2src couldn't agree on the format to use.

What is your V4L2 source? The Pi camera? Have you loaded the V4L2 driver so that /dev/video0 exists?
If some other source, then does it support JPEG? "sudo apt-get install v4l-utils", "v4l2-ctl --list-formats-ext" will tell you the supported formats.

Break the pipe down into small sections and test each of those in turn. You should be able to truncate it almost anywhere and terminate it with fakesink to see if the fragment works.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

PI_newbee
Posts: 172
Joined: Mon Aug 26, 2013 7:41 pm

Re: ERROR: pipeline could not be constructed: no element "v4

Sat Aug 20, 2016 8:32 am

I have two USB webcams and according to LSUSB only one is recognized.
I installed the Logitech webcam ....

Bus 001 Device 006: ID 046d:0819 Logitech, Inc. Webcam C210
Bus 001 Device 005: ID 0458:7089 KYE Systems Corp. (Mouse Systems)
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.

Under /dev directory i found "video0 and video1" files and V4L directory.

This is the output of V4l2 format:
ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: 'YUYV'
Name : YUV 4:2:2 (YUYV)
Size: Discrete 640x480
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 352x288
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 320x240
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 176x144
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)
Size: Discrete 160x120
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.040s (25.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Interval: Discrete 0.067s (15.000 fps)
Interval: Discrete 0.100s (10.000 fps)
Interval: Discrete 0.200s (5.000 fps)

PIN

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9069
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: ERROR: pipeline could not be constructed: no element "v4

Sat Aug 20, 2016 10:59 am

Your webcam doesn't support jpeg directly, therefore it complains when you ask it to. You need to insert a jpeg encoder (jpegenc I think) into your pipe after the v4l2src.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

PI_newbee
Posts: 172
Joined: Mon Aug 26, 2013 7:41 pm

Re: ERROR: pipeline could not be constructed: no element "v4

Mon Aug 22, 2016 10:18 am

i changed the code and added jpeg encoder, but now i have some other problem.
The more i look at gstreamer and examples , i must say it's quite powerfull framework.

Anyway this is the updated code:

Code: Select all

gst-launch -v v4l2src !
jpegenc ! "image/jpeg,width=320,height=240,framerate=30/1" !multipartmux !
tcpserversink host=192.168.101 port=5000 sync=false alsasrc device=hw:1 !
audioconvert ! audioresample ! 'audio/x-raw-int,rate=8000,width=16,channels=1' !
udpsink host=x.x.x.x port=5001
Error:
WARNING: erroneous pipeline: link without sink element

PIN

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9069
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: ERROR: pipeline could not be constructed: no element "v4

Mon Aug 22, 2016 4:59 pm

The fakesink component can be used to terminate any pipe, so test your pipeline bit by bit to find your error.
I can't remember how critical spaces are -you have no space between the! and multipartmux.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

PI_newbee
Posts: 172
Joined: Mon Aug 26, 2013 7:41 pm

Re: ERROR: pipeline could not be constructed: no element "v4

Fri Aug 26, 2016 1:26 pm

I am sorry i could not reply sooner.
The funny part is that i use exactly the same code ( with different camera ) as on this tutorial :

http://sanjosetech.blogspot.hr/2013/05/ ... o-and.html

I would understand that there is a hardware issue but error message doesn't give any use full information, where to look... If it would be HW i guess, error message would point in this direction.
From my point of view, i guess that there must be some problem with packages...

Please be so kind and take a look at the tutorial. If there is no problem then it must be in gstreamer setup / installation.

PIN

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9069
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: ERROR: pipeline could not be constructed: no element "v4

Fri Aug 26, 2016 6:59 pm

PI_newbee wrote:I am sorry i could not reply sooner.
The funny part is that i use exactly the same code ( with different camera ) as on this tutorial :

http://sanjosetech.blogspot.hr/2013/05/ ... o-and.html
The camera used in the blog reports that it supports YUYV and MJPEG. Yours supports YUYV only. There is no way that you can get the camera/v4l2src to produce JPEG data directly (MJPEG can be treated as a continuous form of JPEG).
PI_newbee wrote:I would understand that there is a hardware issue but error message doesn't give any use full information, where to look... If it would be HW i guess, error message would point in this direction.
From my point of view, i guess that there must be some problem with packages...
I've already said, break your pipe down to find where you have an issue. Try each of these in turn to find where your issue is (you still hadn't replied about the seemingly missing space in your command)

Code: Select all

gst-launch -v v4l2src ! jpegenc ! "image/jpeg,width=320,height=240,framerate=30/1" ! fakesink
gst-launch -v v4l2src ! jpegenc ! "image/jpeg,width=320,height=240,framerate=30/1" ! multipartmux ! fakesink
gst-launch -v v4l2src ! jpegenc ! "image/jpeg,width=320,height=240,framerate=30/1" ! multipartmux ! tcpserversink host=192.168.101 port=5000 sync=false 
gst-launch -v alsasrc device=hw:1 ! audioconvert ! fakesink
gst-launch -v alsasrc device=hw:1 ! audioconvert ! audioresample ! 'audio/x-raw-int,rate=8000,width=16,channels=1' ! fakesink
gst-launch -v alsasrc device=hw:1 ! audioconvert ! audioresample ! 'audio/x-raw-int,rate=8000,width=16,channels=1' ! udpsink host=x.x.x.x port=5001

and if ALL of those have worked,
gst-launch -v v4l2src ! jpegenc ! "image/jpeg,width=320,height=240,framerate=30/1" ! multipartmux ! tcpserversink host=192.168.101 port=5000 sync=false \ 
alsasrc device=hw:1 ! audioconvert ! audioresample ! 'audio/x-raw-int,rate=8000,width=16,channels=1' ! udpsink host=x.x.x.x port=5001
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “General discussion”