The problem
I am trying to execute a script. Part of it needs to execute v4l2sink. I tried to execute this
gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video1 & mplayer -tv device=/dev/video1 tv://
to check part of the code and it fails. The problem is the first part, meaning:
gst-launch-1.0 videotestsrc ! v4l2sink device=/dev/video1
I get
WARNING: erroneous pipeline: no element "v4l2sink"
This line should work as it is referenced in the documentation. The following line does not work either and I think the root of the problem is the same.
gst-launch-1.0 -v videotestsrc ! navigationtest ! v4l2sink
WARNING: erroneous pipeline: no element "navigationtest"
That line has been taken from the same part of the documentation.
What I have tried
I checked that /dev/video1 existed and it does. It was created with
sudo modprobe v4l2loopback video_nr=1,10 card_label="mobile_cam","OBS Cam" exclusive_caps=1
Which I took and adapted from the v4l2loopback documentation.
I have check if the module has been blacklisted following other similar questions like this one. It is not blacklisted:
Blacklisted files:
Total count: 0 blacklisted files
Although it is not blacklisted it cannot be found:
gst-inspect-1.0 v4l2sink
No such element or plugin 'v4l2sink'
The whole list of plugins and features is the following:
gst-inspect-1.0
videotestsrc: videotestsrc: Video test source
pbtypes: GstVideoMultiviewFlagsSet (GstDynamicTypeFactory)
coretracers: latency (GstTracerFactory)
coretracers: log (GstTracerFactory)
coretracers: rusage (GstTracerFactory)
coretracers: stats (GstTracerFactory)
coretracers: leaks (GstTracerFactory)
adder: adder: Adder
audiomixer: audiomixer: AudioMixer
audiomixer: liveadder: AudioMixer
audiomixer: audiointerleave: AudioInterleave
videoconvert: videoconvert: Colorspace converter
coreelements: capsfilter: CapsFilter
coreelements: concat: Concat
coreelements: dataurisrc: data: URI source element
coreelements: downloadbuffer: DownloadBuffer
coreelements: fakesrc: Fake Source
coreelements: fakesink: Fake Sink
coreelements: fdsrc: Filedescriptor Source
coreelements: fdsink: Filedescriptor Sink
coreelements: filesrc: File Source
coreelements: funnel: Funnel pipe fitting
coreelements: identity: Identity
coreelements: input-selector: Input selector
coreelements: output-selector: Output selector
coreelements: queue: Queue
coreelements: queue2: Queue 2
coreelements: filesink: File Sink
coreelements: tee: Tee pipe fitting
coreelements: typefind: TypeFind
coreelements: multiqueue: MultiQueue
coreelements: valve: Valve element
coreelements: streamiddemux: Streamid Demux
audiotestsrc: audiotestsrc: Audio test source
audioconvert: audioconvert: Audio converter
opengl: glimagesink: GL Sink Bin
opengl: glimagesinkelement: OpenGL video sink
opengl: glupload: OpenGL uploader
opengl: gldownload: OpenGL downloader
opengl: glcolorconvert: OpenGL color converter
opengl: glcolorbalance: Video balance
opengl: glfilterbin: GL Filter Bin
opengl: glsinkbin: GL Sink Bin
opengl: glsrcbin: GL Src Bin
opengl: glfiltercube: OpenGL cube filter
opengl: gleffects: Gstreamer OpenGL Effects
opengl: gleffects_identity: Do nothing Effect
opengl: gleffects_mirror: Mirror Effect
opengl: gleffects_squeeze: Squeeze Effect
opengl: gleffects_stretch: Stretch Effect
opengl: gleffects_tunnel: Light Tunnel Effect
opengl: gleffects_fisheye: FishEye Effect
opengl: gleffects_twirl: Twirl Effect
opengl: gleffects_bulge: Bulge Effect
opengl: gleffects_square: Square Effect
opengl: gleffects_heat: Heat Signature Effect
opengl: gleffects_sepia: Sepia Toning Effect
opengl: gleffects_xpro: Cross Processing Effect
opengl: gleffects_lumaxpro: Luma Cross Processing Effect
opengl: gleffects_xray: Glowing negative effect
opengl: gleffects_sin: All Grey but Red Effect
opengl: gleffects_glow: Glow Lighting Effect
opengl: gleffects_sobel: Sobel edge detection Effect
opengl: gleffects_blur: Blur with 9x9 separable convolution Effect
opengl: gleffects_laplacian: Laplacian Convolution Demo Effect
opengl: glcolorscale: OpenGL color scale
opengl: glshader: OpenGL fragment shader filter
opengl: glfilterapp: OpenGL application filter
opengl: glviewconvert: OpenGL Multiview/3D conversion filter
opengl: glstereosplit: GLStereoSplit
opengl: gltestsrc: Video test source
opengl: gldeinterlace: OpenGL deinterlacing filter
opengl: glfilterglass: OpenGL glass filter
app: appsrc: AppSrc
app: appsink: AppSink
encoding: encodebin: Encoder Bin
ximagesink: ximagesink: Video sink
videorate: videorate: Video rate adjuster
subparse: subparse_typefind: srt, sub, mpsub, mdvd, smi, txt, dks, vtt
subparse: subparse: Subtitle parser
subparse: ssaparse: SSA Subtitle Parser
gio: giosink: GIO sink
gio: giosrc: GIO source
gio: giostreamsink: GIO stream sink
gio: giostreamsrc: GIO stream source
volume: volume: Volume
tcp: socketsrc: socket source
tcp: tcpclientsink: TCP client sink
tcp: tcpclientsrc: TCP client source
tcp: tcpserversink: TCP server sink
tcp: tcpserversrc: TCP server source
tcp: multifdsink: Multi filedescriptor sink
tcp: multisocketsink: Multi socket sink
videoscale: videoscale: Video scaler
rawparse: unalignedaudioparse: unalignedaudioparse
rawparse: unalignedvideoparse: unalignedvideoparse
rawparse: rawaudioparse: rawaudioparse
rawparse: rawvideoparse: rawvideoparse
playback: playbin: Player Bin 2
playback: playbin3: Player Bin 3
playback: playsink: Player Sink
playback: subtitleoverlay: Subtitle Overlay
playback: streamsynchronizer: Stream Synchronizer
playback: decodebin: Decoder Bin
playback: decodebin3: Decoder Bin 3
playback: uridecodebin: URI Decoder
playback: uridecodebin3: URI Decoder
playback: urisourcebin: URI reader
playback: parsebin: Parse Bin
audioresample: audioresample: Audio resampler
audiorate: audiorate: Audio rate adjuster
typefindfunctions: video/x-ms-asf: asf, wm, wma, wmv
typefindfunctions: audio/x-musepack: mpc, mpp, mp+
typefindfunctions: audio/x-au: au, snd
typefindfunctions: video/x-msvideo: avi
typefindfunctions: audio/qcelp: qcp
typefindfunctions: video/x-cdxa: dat
typefindfunctions: video/x-vcd: dat
typefindfunctions: audio/x-imelody: imy, ime, imelody
typefindfunctions: audio/midi: mid, midi
typefindfunctions: audio/riff-midi: mid, midi
typefindfunctions: audio/mobile-xmf: mxmf
typefindfunctions: video/x-fli: flc, fli
typefindfunctions: application/x-id3v2: mp3, mp2, mp1, mpga, ogg, flac, tta
typefindfunctions: application/x-id3v1: mp3, mp2, mp1, mpga, ogg, flac, tta
typefindfunctions: application/x-apetag: mp3, ape, mpc, wv
typefindfunctions: audio/x-ttafile: tta
typefindfunctions: audio/x-mod: 669, amf, ams, dbm, digi, dmf, dsm, gdm, far, imf, it, j2b, mdl, med, mod, mt2, mtm, okt, psm, ptm, sam, s3m, stm, stx, ult, umx, xm
typefindfunctions: audio/mpeg: mp3, mp2, mp1, mpga
typefindfunctions: audio/x-ac3: ac3, eac3
typefindfunctions: audio/x-dts: dts
typefindfunctions: audio/x-gsm: gsm
typefindfunctions: video/mpeg-sys: mpe, mpeg, mpg
typefindfunctions: video/mpegts: ts, mts
typefindfunctions: application/ogg: ogg, oga, ogv, ogm, ogx, spx, anx, axa, axv
typefindfunctions: video/mpeg-elementary: mpv, mpeg, mpg
typefindfunctions: video/mpeg4: m4v
typefindfunctions: video/x-h263: h263, 263
typefindfunctions: video/x-h264: h264, x264, 264
typefindfunctions: video/x-h265: h265, x265, 265
typefindfunctions: video/x-nuv: nuv
typefindfunctions: audio/x-m4a: m4a
typefindfunctions: application/x-3gp: 3gp
typefindfunctions: video/quicktime: mov, mp4
typefindfunctions: image/x-quicktime: qif, qtif, qti
typefindfunctions: image/jp2: jp2
typefindfunctions: image/x-jpc: jpc, j2k
typefindfunctions: video/mj2: mj2
typefindfunctions: text/html: htm, html
typefindfunctions: application/vnd.rn-realmedia: ra, ram, rm, rmvb
typefindfunctions: application/x-pn-realaudio: ra, ram, rm, rmvb
typefindfunctions: application/x-shockwave-flash: swf, swfl
typefindfunctions: application/dash+xml: mpd, MPD
typefindfunctions: application/vnd.ms-sstr+xml: no extensions
typefindfunctions: video/x-flv: flv
typefindfunctions: text/plain: txt
typefindfunctions: text/utf-16: txt
typefindfunctions: text/utf-32: txt
typefindfunctions: text/uri-list: ram
typefindfunctions: application/itc: itc
typefindfunctions: application/x-hls: m3u8
typefindfunctions: application/sdp: sdp
typefindfunctions: application/smil: smil
typefindfunctions: application/ttml+xml: ttml+xml
typefindfunctions: application/xml: xml
typefindfunctions: audio/x-wav: wav
typefindfunctions: audio/x-aiff: aiff, aif, aifc
typefindfunctions: audio/x-svx: iff, svx
typefindfunctions: audio/x-paris: paf
typefindfunctions: audio/x-nist: nist
typefindfunctions: audio/x-voc: voc
typefindfunctions: audio/x-sds: sds
typefindfunctions: audio/x-ircam: sf
typefindfunctions: audio/x-w64: w64
typefindfunctions: audio/x-rf64: rf64
typefindfunctions: audio/x-shorten: shn
typefindfunctions: application/x-ape: ape
typefindfunctions: image/jpeg: jpg, jpe, jpeg
typefindfunctions: image/gif: gif
typefindfunctions: image/png: png
typefindfunctions: image/bmp: bmp
typefindfunctions: image/tiff: tif, tiff
typefindfunctions: image/webp: webp
typefindfunctions: image/x-exr: exr
typefindfunctions: image/x-portable-pixmap: pnm, ppm, pgm, pbm
typefindfunctions: video/x-matroska: mkv, mka, mk3d, webm
typefindfunctions: application/mxf: mxf
typefindfunctions: video/x-mve: mve
typefindfunctions: video/x-dv: dv, dif
typefindfunctions: audio/x-amr-nb-sh: amr
typefindfunctions: audio/x-amr-wb-sh: amr
typefindfunctions: audio/iLBC-sh: ilbc
typefindfunctions: audio/x-sbc: sbc
typefindfunctions: audio/x-sid: sid
typefindfunctions: image/x-xcf: xcf
typefindfunctions: video/x-mng: mng
typefindfunctions: image/x-jng: jng
typefindfunctions: image/x-xpixmap: xpm
typefindfunctions: image/x-sun-raster: ras
typefindfunctions: application/x-bzip: bz2
typefindfunctions: application/x-gzip: gz
typefindfunctions: application/zip: zip
typefindfunctions: application/x-compress: Z
typefindfunctions: subtitle/x-kate: no extensions
typefindfunctions: application/x-subtitle-vtt: vtt
typefindfunctions: audio/x-flac: flac
typefindfunctions: audio/x-vorbis: no extensions
typefindfunctions: video/x-theora: no extensions
typefindfunctions: application/x-ogm-video: no extensions
typefindfunctions: application/x-ogm-audio: no extensions
typefindfunctions: application/x-ogm-text: no extensions
typefindfunctions: audio/x-speex: no extensions
typefindfunctions: audio/x-celt: no extensions
typefindfunctions: application/x-ogg-skeleton: no extensions
typefindfunctions: text/x-cmml: no extensions
typefindfunctions: application/x-executable: no extensions
typefindfunctions: audio/aac: aac, adts, adif, loas
typefindfunctions: audio/x-spc: spc
typefindfunctions: audio/x-wavpack: wv, wvp
typefindfunctions: audio/x-wavpack-correction: wvc
typefindfunctions: audio/x-caf: caf
typefindfunctions: application/postscript: ps
typefindfunctions: image/svg+xml: svg
typefindfunctions: application/x-rar: rar
typefindfunctions: application/x-tar: tar
typefindfunctions: application/x-ar: a
typefindfunctions: application/x-ms-dos-executable: dll, exe, ocx, sys, scr, msstyles, cpl
typefindfunctions: video/x-dirac: no extensions
typefindfunctions: multipart/x-mixed-replace: no extensions
typefindfunctions: application/x-mmsh: no extensions
typefindfunctions: video/vivo: viv
typefindfunctions: audio/x-nsf: nsf
typefindfunctions: audio/x-gym: gym
typefindfunctions: audio/x-ay: ay
typefindfunctions: audio/x-gbs: gbs
typefindfunctions: audio/x-vgm: vgm
typefindfunctions: audio/x-sap: sap
typefindfunctions: video/x-ivf: ivf
typefindfunctions: audio/x-kss: kss
typefindfunctions: application/pdf: pdf
typefindfunctions: application/msword: doc
typefindfunctions: image/vnd.adobe.photoshop: psd
typefindfunctions: image/vnd.wap.wbmp: no extensions
typefindfunctions: application/x-yuv4mpeg: no extensions
typefindfunctions: image/x-icon: no extensions
typefindfunctions: image/x-degas: no extensions
typefindfunctions: application/octet-stream: no extensions
typefindfunctions: application/x-ssa: ssa, ass
typefindfunctions: video/x-pva: pva
typefindfunctions: audio/x-xi: xi
typefindfunctions: audio/audible: aa, aax
staticelements: bin: Generic bin
staticelements: pipeline: Pipeline object
Total count: 25 plugins, 253 features
I have removed the cache by running:
rm -rf .cache/gstreamer-1
Nothing changed.
I have removed completely gstreamer and I have reinstalled it again with the following command (it is longer than need but I have reinstalled some packages that were also remove when gstreamer was removed.)
sudo apt install libgstreamer1.0-0 gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-doc gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio calibre evince gir1.2-gst-plugins-base-1.0 gir1.2-gstreamer-1.0 gstreamer-qapt gstreamer1.0-alsa gstreamer1.0-doc gstreamer1.0-fluendo-mp3 gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-libav gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly gstreamer1.0-pulseaudio gstreamer1.0-qt5 gstreamer1.0-tools gstreamer1.0-vaapi gstreamer1.0-x kaccounts-integration kde-runtime kdelibs5-plugins kinfocenter kio-gdrive ksysguard ktorrent kubuntu-desktop kwin kwin-addons kwin-common kwin-x11 libevview3-3 libgstreamer-gl1.0-0 libgstreamer-plugins-bad1.0-0 libgstreamer-plugins-base1.0-0 libgstreamer-plugins-good1.0-0 libgstreamer1.0-0 libgstreamer1.0-dev libkdewebkit5 libkf5webkit5 libplasma3 libprocessui7 libqgsttools-p1 libqt5multimedia5-plugins libqt5webkit5 libqtwebkit4 libreoffice-avmedia-backend-gstreamer libreoffice-kde libreoffice-kde4 libspice-server1 libwebkit2gtk-4.0-37 liferea oem-config oem-config-kde packagekit packagekit-tools phonon-backend-gstreamer phonon4qt5-backend-gstreamer plasma-desktop plasma-discover plasma-scriptengine-javascript plasma-widgets-addons plasma-workspace pychess python-pyqt5.qtwebkit python3-pyqt5.qtwebkit qemu-kvm qemu-system-x86 qml-module-qtmultimedia qml-module-qtwebkit qt5-assistant qttools5-dev-tools sddm-theme-breeze signon-ui-x11 ubiquity ubiquity-frontend-kde zenity
Which includes the good plugins, where the v4l2sink is contained as you can see here. No problems came out from the installation but the problem persisted.
I have double-checked that the plugins have been properly installed:
sudo apt install gstreamer1.0-plugins-good
Reading package lists... Done
Building dependency tree
Reading state information... Done
gstreamer1.0-plugins-good is already the newest version (1.14.5-0ubuntu1~18.04.1).
0 upgraded, 0 newly installed, 0 to remove and 69 not upgraded.
I run also the following command
locate libgstvideo4linux2.so
This library contains the element v4l2sink that I was trying to use as you can see here. I got
/usr/lib/x86_64-linux-gnu/gstreamer-1.0
I have seen that LD_LIBRARY_PATH did not contain this directory so I added it by running:
export LD_LIBRARY_PATH=/lib:/usr/lib:/usr/local/lib/:/usr/lib/x86_64-linux-gnu/gstreamer-1.0
I know this only change the path in the current terminal, so I run again the same commands I listed before in that terminal and it returned the same results.