Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streaming ioctls errors #87

Open
philippulus opened this issue Jun 16, 2024 · 26 comments
Open

Streaming ioctls errors #87

philippulus opened this issue Jun 16, 2024 · 26 comments

Comments

@philippulus
Copy link

philippulus commented Jun 16, 2024

Succeeded installing the module on Ubuntu 24.04 LTS on Wayland.
Configuration file is the one proposed by Linux Fake Background Webcam.

Two devices have correctly been created:
$ ls /dev/video*
Akvcam should have created two extra video devices.
( yes: /dev/video0 /dev/video1 )

The camera starts also capturing correctly with:
$ ffplay /dev/video0

However, I seem to have compliance issues with Streaming iocts errors and warnings:
$ v4l2-compliance -d /dev/video0 -f -s

Screenshot from 2024-06-16 18-44-42

In addition, I don't have any alternative camera in video apps (Zoom, Signal, Cheese).
Not sure if this is connected to the streaming issues detailed above.

@hipersayanX
Copy link
Member

hipersayanX commented Jun 16, 2024

Compliance errors may vary from each kernel, and are in most cases just a mere warning, the important part here is if the client software can detect and capture the virtual camera. Try streaming with FFmpeg and capturing with ffplay, if that works, then everything is ready and working.
Also, you can define which device is the the output and which is for capture setting the the videonr property, since isn't clear which one you are using for testing.

@philippulus
Copy link
Author

Thank you @hipersayanX

Capture works fine as mentioned above with /dev/video0, and also with VLC, but streaming does not with /dev/video1.
I took precautions to install gstreamer, ffmpeg and webm ppa.
Neither gstreamer nor ffmpeg does seem to work:

$ gst-launch-1.0 -v videotestsrc ! video/x-raw,format=RGB ! videoconvert ! v4l2sink device=/dev/video1
Setting pipeline to PAUSED ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video1' is not a output device.
Additional debug info:
../sys/v4l2/v4l2_calls.c(640): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
Capabilities: 0x4a00000
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
$

$ ffmpeg -i video.webm -s 640x480 -r 30 -f v4l2 -vcodec rawvideo -pix_fmt rgb24 /dev/video1
../..
[in#0 @ 0x5a3d098b6300] Error opening input: No such file or directory
Error opening input file video.webm.
Error opening input files: No such file or directory
$

@hipersayanX
Copy link
Member

ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video1' is not a output device.

Because, probably confusing the device, /dev/video0 is probably the output device and /dev/video1 is the capture device.

[in#0 @ 0x5a3d098b6300] Error opening input: No such file or directory
Error opening input file video.webm.
Error opening input files: No such file or directory

You must point to a valid video file in your computer.

@philippulus
Copy link
Author

philippulus commented Jun 19, 2024

[in#0 @ 0x5a3d098b6300] Error opening input: No such file or directory
Error opening input file video.webm.
Error opening input files: No such file or directory

You must point to a valid video file in your computer.

OK, added a valid video file now, but still getting an error message:
$ ffmpeg -i /home/username/energy.mp4 -s 640x480 -r 30 -f v4l2 -vcodec rawvideo -pix_fmt rgb24 /dev/video1
../..
[video4linux2,v4l2 @ 0x6348c6f18bc0] ioctl(VIDIOC_G_FMT): Invalid argument
[out#0/video4linux2,v4l2 @ 0x6348c6ea5640] Could not write header (incorrect codec parameters ?): Invalid argument
Error while filtering: Invalid argument
[out#0/video4linux2,v4l2 @ 0x6348c6ea5640] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=N/A bitrate=N/A speed=N/A
Conversion failed!
$

@philippulus
Copy link
Author

ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video1' is not a output device.

Because, probably confusing the device, /dev/video0 is probably the output device and /dev/video1 is the capture device.

No, no, dev/video0 is the correct capture device, and get the same error message if I replce /dev/video1 with dev/video0 in the above command line.

I correctly get the camera starting with $ ffplay /dev/video0 as the capture device

This is the part of config.ini defining the video devices:

[Cameras]
cameras/size = 2

cameras/1/type = output
cameras/1/mode = mmap, userptr, rw
cameras/1/description = Akvcam (Output device)
cameras/1/formats = 1

cameras/2/type = capture
cameras/2/mode = mmap, rw
cameras/2/description = Akvcam (Capture device)
cameras/2/formats = 1

@philippulus
Copy link
Author

@hipersayanX , do you have any idea about the issues above?

@hipersayanX
Copy link
Member

Show me the the full /etc/akvcam/config.ini.

@philippulus
Copy link
Author

Sure, configuration file is the one proposed by Linux Fake Background Webcam:

[General]
default_frame=/etc/akvcam/default_frame.bmp

[Cameras]
cameras/size = 2

cameras/1/type = output
cameras/1/mode = mmap, userptr, rw
cameras/1/description = Akvcam (Output device)
cameras/1/formats = 1

cameras/2/type = capture
cameras/2/mode = mmap, rw
cameras/2/description = Akvcam (Capture device)
cameras/2/formats = 1

[Formats]
formats/size = 1

formats/1/format = YUY2
formats/1/width = 1280
formats/1/height = 720
formats/1/fps = 30

[Connections]
connections/size = 1
connections/1/connection = 1:2

@hipersayanX
Copy link
Member

For the moment, the output device only supports RGB24, I want to port the Webcamoid's video format conversion code to the virtual camera in future versions.
Change the config.ini to:

[Cameras]
cameras/size = 2

cameras/1/type = output
cameras/1/mode = mmap, userptr, rw
cameras/1/description = Akvcam (Output device)
cameras/1/formats = 2

cameras/2/type = capture
cameras/2/mode = mmap, rw
cameras/2/description = Akvcam (Capture device)
cameras/2/formats = 1

[Formats]
formats/size = 2

formats/1/format = YUY2
formats/1/width = 1280
formats/1/height = 720
formats/1/fps = 30

formats/2/format = RGB24
formats/2/width = 1280
formats/2/height = 720
formats/2/fps = 30

[Connections]
connections/size = 1
connections/1/connection = 1:2

@philippulus
Copy link
Author

@hipersayanX

Still getting error messages with both streaming command lines after editing config.ini exactly as per your proposal.

$ gst-launch-1.0 -v videotestsrc ! video/x-raw,format=RGB ! videoconvert ! v4l2sink device=/dev/video1
Setting pipeline to PAUSED ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video1' is not a output device.
Additional debug info:
../sys/v4l2/v4l2_calls.c(640): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
Capabilities: 0x4a00000
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
$

$ ffmpeg -i /home/nicolas/energy.mp4 -s 640x480 -r 30 -f v4l2 -vcodec rawvideo -pix_fmt rgb24 /dev/video1
ffmpeg version 6.1.1-3ubuntu5+esm1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13 (Ubuntu 13.2.0-23ubuntu4)
configuration: --prefix=/usr --extra-version=3ubuntu5+esm1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libvpl --disable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared
WARNING: library configuration mismatch
avcodec configuration: --prefix=/usr --extra-version=3ubuntu5+esm1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --disable-omx --enable-gnutls --enable-libaom --enable-libass --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libharfbuzz --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-openal --enable-opencl --enable-opengl --disable-sndio --enable-libvpl --disable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-ladspa --enable-libbluray --enable-libjack --enable-libpulse --enable-librabbitmq --enable-librist --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libx264 --enable-libzmq --enable-libzvbi --enable-lv2 --enable-sdl2 --enable-libplacebo --enable-librav1e --enable-pocketsphinx --enable-librsvg --enable-libjxl --enable-shared --enable-version3 --disable-doc --disable-programs --disable-static --enable-libaribb24 --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc --enable-libsmbclient
libavutil 58. 29.100 / 58. 29.100
libavcodec 60. 31.102 / 60. 31.102
libavformat 60. 16.100 / 60. 16.100
libavdevice 60. 3.100 / 60. 3.100
libavfilter 9. 12.100 / 9. 12.100
libswscale 7. 5.100 / 7. 5.100
libswresample 4. 12.100 / 4. 12.100
libpostproc 57. 3.100 / 57. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/nicolas/energy.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf59.16.100
Duration: 00:00:42.30, start: 0.000000, bitrate: 8618 kb/s
Stream #0:00x1: Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 8441 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
Metadata:
handler_name : VideoHandler
vendor_id : [0][0][0][0]
Stream #0:10x2: Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 168 kb/s (default)
Metadata:
handler_name : SoundHandler
vendor_id : [0][0][0][0]
Stream mapping:
Stream #0:0 -> #0:0 (h264 (native) -> rawvideo (native))
Press [q] to stop, [?] for help
[video4linux2,v4l2 @ 0x617b4d44cbc0] ioctl(VIDIOC_G_FMT): Invalid argument
[out#0/video4linux2,v4l2 @ 0x617b4d3d9640] Could not write header (incorrect codec parameters ?): Invalid argument
Error while filtering: Invalid argument
[out#0/video4linux2,v4l2 @ 0x617b4d3d9640] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=N/A bitrate=N/A speed=N/A
Conversion failed!
$

@hipersayanX
Copy link
Member

Did you had reloaded the module after editing the config.ini?

@philippulus
Copy link
Author

@hipersayanX

I had not, just did it, but after that error messages remain the same.

$ sudo rmmod akvcam
rmmod: ERROR: Module akvcam is not currently loaded
$ sudo modprobe akvcam
$ lsmod | grep akvcam
akvcam 225280 0
videobuf2_vmalloc 20480 2 uvcvideo,akvcam
videobuf2_v4l2 40960 2 uvcvideo,akvcam
videodev 364544 3 videobuf2_v4l2,uvcvideo,akvcam
videobuf2_common 86016 5 videobuf2_vmalloc,videobuf2_v4l2,uvcvideo,akvcam,videobuf2_memops
$

@hipersayanX
Copy link
Member

hipersayanX commented Jun 27, 2024

You have this

formats/2/format = RGB24
formats/2/width = 1280 👈
formats/2/height = 720 👈
formats/2/fps = 30

and then this

$ ffmpeg -i /home/nicolas/energy.mp4 -s 👉 640x480 👈 -r 30 -f v4l2 -vcodec rawvideo -pix_fmt rgb24 /dev/video1

how would you fix the command or the config.ini?

@philippulus
Copy link
Author

@hipersayanX

Thank you.
changed the code line to:
$ ffmpeg -i /home/nicolas/energy.mp4 -s 1280x720 -r 30 -f v4l2 -vcodec rawvideo -pix_fmt rgb24 /dev/video1

but still get the same error:

[video4linux2,v4l2 @ 0x5a7b6232abc0] ioctl(VIDIOC_G_FMT): Invalid argument
[out#0/video4linux2,v4l2 @ 0x5a7b622b7640] Could not write header (incorrect codec parameters ?): Invalid argument
Error while filtering: Invalid argument
[out#0/video4linux2,v4l2 @ 0x5a7b622b7640] Nothing was written into output file, because at least one of its streams received no packets.
frame= 0 fps=0.0 q=0.0 Lsize= 0kB time=N/A bitrate=N/A speed=N/A
Conversion failed!
$

Changing the resolution in the command also does not explain why streaming with gstreamer also does not work.

$ gst-launch-1.0 -v videotestsrc ! video/x-raw,format=RGB ! videoconvert ! v4l2sink device=/dev/video1
Setting pipeline to PAUSED ...
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video1' is not a output device.
Additional debug info:
../sys/v4l2/v4l2_calls.c(640): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
Capabilities: 0x4a00000
ERROR: pipeline doesn't want to preroll.
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
$

@hipersayanX
Copy link
Member

Could not write header (incorrect codec parameters ?): Invalid argument
Device '/dev/video1' is not a output device.

Your config.ini is wrong or you are confusing the devices. Why not just create the virtual camera using Webcamoid instead of doing manually? at least until you learn how to configure the cameras.

@philippulus
Copy link
Author

philippulus commented Jul 2, 2024

@hipersayanX

This is what I did and nothing else, creating the virtual cameras with webcamoid, and the config.ini file is the one you proposed above.

Here is the installation procedure I followed:

  1. $ sudo apt-get install dkms
  2. Download latest release, make it executable, then:
    $ sudo ./akvcam-installer-gui-linux-1.2.6.run (keep it in /opt/akvcam)
  3. After installing the modules with the installer, you can check that the module was installed with:
    $ sudo cat /lib/modules/$(uname -r)/modules.dep | grep akvcam
  4. Then load the module with:
    $ sudo modprobe akvcam
  5. Then check that the module was loaded with:
    $ lsmod | grep akvcam
  6. Create configuration file:
    1. sudo mkdir -p /etc/akvcam
    2. sudo touch /etc/akvcam/config.ini
    3. sudo chmod -vf 644 /etc/akvcam/config.ini
  7. Note down the output of
    $ ls /dev/video*
    Akvcam should have created two extra video devices.
    ( yes: /dev/video0 /dev/video1 )
  8. Check if the driver is ok with:
    $ v4l2-compliance -d /dev/videoX -f -s
  9. Check if all configured formats and emulated controls are ok with this command:
    $ v4l2-ctl -d /dev/videoX --all
  10. Capture video, e.g. with ffplay:
    $ sudo apt install ffmpeg
    $ ffplay /dev/video0
  11. Install gstreamer from store

When testing the cameras with gstreamer and ffmpeg with the above command lines, then I get the error messages copied in the previous message.

Screenshot from 2024-07-02 10-37-02

Screenshot from 2024-07-02 10-36-43

@hipersayanX
Copy link
Member

Does Webcamoid send the video signal to the virtual cameras?

@philippulus
Copy link
Author

philippulus commented Jul 3, 2024

@hipersayanX

For some reasons now I have remaining cameras after unloading the module:

$ sudo rmmod akvcam
$ lsmod | grep akvcam
$ ls /dev/video*
/dev/video0 /dev/video1
$ sudo modprobe akvcam
$ ls /dev/video*
/dev/video0 /dev/video1 /dev/video2 /dev/video3
$ lsmod | grep akvcam
akvcam 225280 0
videobuf2_vmalloc 20480 2 uvcvideo,akvcam
videobuf2_v4l2 40960 2 uvcvideo,akvcam
videodev 364544 3 videobuf2_v4l2,uvcvideo,akvcam
videobuf2_common 86016 5 videobuf2_vmalloc,videobuf2_v4l2,uvcvideo,akvcam,videobuf2_memops

So now checking the driver returns a positive result:

$ v4l2-compliance -d /dev/video2 -f -s
v4l2-compliance 1.26.1, 64 bits, 64-bit time_t

Compliance test for akvcam device /dev/video2:

Driver Info:
Driver name : akvcam
Card type : Akvcam (Output device)
Bus info : platform:akvcam-2
Driver version : 6.8.4
Capabilities : 0x85200002

../..
Stream using all formats:
test MMAP for Format RGB3, Frame Size [email protected] Hz:
Stride 3840, Field None: OK
Total for akvcam device /dev/video2: 56, Succeeded: 56, Failed: 0, Warnings: 0

Then video2 appears to be the output device

$ v4l2-compliance -d /dev/video3 -f -s
v4l2-compliance 1.26.1, 64 bits, 64-bit time_t

Compliance test for akvcam device /dev/video3:

Driver Info:
Driver name : akvcam
Card type : Akvcam (Capture device)
Bus info : platform:akvcam-3
Driver version : 6.8.4
Capabilities : 0x85200001

../..
Stream using all formats:
test MMAP for Format YUYV, Frame Size [email protected] Hz:
Stride 2560, Field None: OK
Total for akvcam device /dev/video3: 56, Succeeded: 56, Failed: 0, Warnings: 0

and video3 the capture device...

So now testing with ffmpeg, there is a streaming process running, which stops after a short time:

$ ffmpeg -i /home/nicolas/energy.mp4 -s 1280x720 -r 30 -f v4l2 -vcodec rawvideo -pix_fmt rgb24 /dev/video2
../..
image
$

the output file is NOT modified, remains the same as before.
Is that file (energy.mp4) not supposed to be overwritten? If not, what is the purpose of directing the output to this file?

$ gst-launch-1.0 -v videotestsrc ! video/x-raw,format=RGB ! videoconvert ! v4l2sink device=/dev/video2
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0
/GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0.GstPad:sink: caps = video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
0:01:18.6 / 99:99:99.

Now as well testing with gstreamer, there is indeed a process running...

$ gst-launch-1.0 -v videotestsrc ! video/x-raw,format=RGB ! videoconvert ! v4l2sink device=/dev/video2
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0
/GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0.GstPad:sink: caps = video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)RGB, width=(int)1280, height=(int)720, framerate=(fraction)30/1, multiview-mode=(string)mono, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, colorimetry=(string)1:1:0:0
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
Redistribute latency...
New clock: GstSystemClock
0:01:18.6 / 99:99:99.

So now it seems that I am all set?

I am checking with Cheese, and indeed have the Akvcam camera additionally, but with an error message.

image

However, when testing the capture device, there is a video window opening, but it only shows noise, does not capture an actual video.
What do I need to do so that there is an actual video capture running?

$ ffplay /dev/video3

Screenshot from 2024-07-03 11-19-59

@hipersayanX
Copy link
Member

For some reasons now I have remaining cameras after unloading the module:

Are you sure rmmod executed properly without any error? Also, try removing all cameras from Webcamoid and creating a new one from cero. I think you are not working with a clean environment when testing, and that's why you are getting all those errors.

the output file is NOT modified, remains the same as before.
Is that file (energy.mp4) not supposed to be overwritten? If not, what is the purpose of directing the output to this file?

You are confused here, energy.mp4 is the input file, is from were FFmpeg takes the video signal and send to the virtual camera, the input file is never modified.

What do I need to do so that there is an actual video capture running?

Try playing the desktop, a video, an image, or whatever with Webcamoid, and capture with ffplay, does it work?

@philippulus
Copy link
Author

philippulus commented Jul 13, 2024

@hipersayanX

Are you sure rmmod executed properly without any error? Also, try removing all cameras from Webcamoid and creating a new one from cero. I think you are not working with a clean environment when testing, and that's why you are getting all those errors.

The two cameras are existing even with akvcam not loaded:
$ sudo rmmod akvcam
rmmod: ERROR: Module akvcam is not currently loaded
$ ls /dev/video*
/dev/video0 /dev/video1

I have tried by force deleting the files /dev/video0 and /dev/video1 but this broke my system. I had to reboot with an older kernel and update/upgrade. Also my laptop webcam is no longer available (Cheese says no camera available). I also have corresponding folders in /sys/class/video4linux. So how do I please remove the cameras from within webcamoid?

Screenshot from 2024-07-13 11-35-15

Are you sure rmmod executed properly without any error?

Try playing the desktop, a video, an image, or whatever with Webcamoid, and capture with ffplay, does it work?

I don't know how to do that. Can you please explain how can I do 'playing the desktop, a video, an image' and how do I capture this stream with ffplay? Please understand I am not a coder and just looking for a technical solution.

@hipersayanX
Copy link
Member

The two cameras are existing even with akvcam not loaded:

$ sudo rmmod akvcam
rmmod: ERROR: Module akvcam is not currently loaded
$ ls /dev/video*
/dev/video0 /dev/video1

If akvcam is unloaded and you still have /dev/video*, then those are you real cameras and not the virtual ones.

Also my laptop webcam is no longer available (Cheese says no camera available).

Just reboot your system.

So how do I please remove the cameras from within webcamoid?

Main menu/Video/Outputs/Remove all outputs

I don't know how to do that. Can you please explain how can I do 'playing the desktop, a video, an image'

From Webcamoid, select any video source, and select the output virtual camera, that is.

and how do I capture this stream with ffplay? Please understand I am not a coder and just looking for a technical solution.

ffplay /dev/videoNumberOfTheVirtualCamera

@hipersayanX
Copy link
Member

hipersayanX commented Jul 13, 2024

But I still don't understand why do you want to configure the virtual cameras manually instead of using Webcamoid, if you don't have experience with Linux internals it's like running in a street of pointed rocks.

@philippulus
Copy link
Author

@hipersayanX

But I still don't understand why do you want to configure the virtual cameras manually instead of using Webcamoid, if you don't have experience with Linux internals it's like running in a street of pointed rocks.

I don't have a 'webcamoid' app or gui installed.
From your description I understand it can only be installed and run with code lines.
This is the reason why.
These are the only cam apps installed I have.

Screenshot from 2024-07-13 18-14-43

@hipersayanX
Copy link
Member

I don't have a 'webcamoid' app or gui installed.

You can install it from the repositories or from the official binaries.

From your description I understand it can only be installed and run with code lines.

Yes, it can be installed, configured, and used from the command line, but you need experience with the command line.

For example, here you are trying to stream to a capture device instead of the output device, you could have fixed that just by changing the device number until it worked.
This error message indicate you are trying to stream with the wrong format.
Here, there are video devices remaining after unloading the module, which is not possible unless you are confusing the virtual devices with the real devices, also it seems to me that you don't have experience using ffmpeg because you confused the input file with an output file.
Summarizing all together, that's why I think you are trying to run a nuclear plant barely knowing kinematics, that is how I see the situation from my point of view.

@philippulus
Copy link
Author

philippulus commented Jul 15, 2024

@hipersayanX

You can install it from the repositories or from the official binaries.

I have indeed from the start installed the gui according to:
$ sudo apt-get install dkms
$ sudo ./akvcam-installer-gui-linux-1.2.6.run (installed in /opt/akvcam as show in my message from two weeks ago above)
I loaded the module with
$ sudo modprobe akvcam
I have created the configuration file and modified it using your proposal.
But I don't know how to start the gui, I would love to do so but it is not mentioned anywhere how?
Is the command '$ sudo modprobe akvcam' supposed to load the gui or is there another command to start it up?

@hipersayanX
Copy link
Member

I have indeed from the start installed the gui according to:
$ sudo apt-get install dkms
$ sudo ./akvcam-installer-gui-linux-1.2.6.run (installed in /opt/akvcam as show in my message from two weeks ago above)

That is not the GUI, the virtual camera has not any GUI, it is just the kernel module. If you want to manage the virtual camera graphically, you must install Webcamoid.

But I don't know how to start the gui, I would love to do so but it is not mentioned anywhere how?

You are confusing the projects, akvcam is just the virtual camera, Webcamoid is the main project, it's not mentioned anywhere in the akvcam wiki that you must install Webcamoid, because both can be used separately, you can install and use akvcam without Webcamoid, and you can install and use Webcamoid without akvcam.
akvcam is for other developers or advanced users to create virtual cameras with their own tools, with their own GUI, scripts or whatever.
akvcam and Webcamoid are part of the same project, yet they are managed independently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants