Using my laptop camera?

What program is installed on EOS for using my laptop camera? If it is not installed, is there any suggestions? I would like to use one with some CLI support.

Look up v4l2-ctl and ffmpeg (you probably have everything installed already).

v4l2-ctl --list-devices

Lists all your webcams. It will probably be /dev/video0 or something like that.

Then you can do something like:

ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0 output.mkv

to record some footage. Adjust the options for your specific case (make sure you read the documentation and understand them), don’t just blindly run the above command.

wow. that looks amazing, so I can use it like all other devices. Is there a way to take a picture with it too? Like using that picture in a script?

Yeah. Probably something like

ffmpeg -f v4l2 -video_size 640x480 -i /dev/video0 -ss 0:0:2 -frames 1 output.jpg

hmm, showing two devices for me, eventho my laptop uses only one:

❯ sudo find /dev | grep video

/dev/v4l/by-path/pci-0000:00:14.0-usb-0:7:1.0-video-index0
/dev/v4l/by-path/pci-0000:00:14.0-usb-0:7:1.0-video-index1
/dev/v4l/by-id/usb-Generic_Integrated_Camera_0001-video-index0
/dev/v4l/by-id/usb-Generic_Integrated_Camera_0001-video-index1
/dev/video1
/dev/video0

What does

v4l2-ctl --list-devices

print?

Integrated Camera: Integrated C (usb-0000:00:14.0-7):
	/dev/video0
	/dev/video1
	/dev/media0

Try video0, if it doesn’t work, try video1. Probably both will work.

❯ ffmpeg -f v4l2 -video-size 640x480 -i /dev/video0 -ss 0:0:2 -frames 1 output.jpg
ffmpeg version n6.0 Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13.1.1 (GCC) 20230429
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
Unrecognized option 'video-size'.
Error splitting the argument list: Option not found

Sorry, it’s -video_size. My mistake :slight_smile:

1 Like

NOICE!!! thank you very much. FFMPEG is very fascinating program.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.