i can't use my digital camera ( Canon ixus 160) as webcam is there an application for that ? or just in the settings


Here's another solution.

List of gphoto2 supported cameras: http://gphoto.org/proj/libgphoto2/support.php

You need install gphoto, v4l2loopback-utils and ffmpeg.


sudo modprobe v4l2loopback


gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video1

Now you have webcamera from your digital camera.

  • I get this error (cut at top): Input #0, mjpeg, from 'pipe:': Duration: N/A, bitrate: N/A Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 1056x704, 25 tbr, 1200k tbn, 25 tbc Stream mapping: Stream #0:0 -> #0:0 (mjpeg (native) -> rawvideo (native)) [swscaler @ 0x559c14f77de0] deprecated pixel format used, make sure you did set range correctly [v4l2 @ 0x559c14f42fc0] ioctl(VIDIOC_G_FMT): Invalid argument Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Error initializing output stream 0:0 -- Conversion failed! ➜ ~ – noreabu Nov 4 '17 at 11:01

This can be done but requires a number of steps. First, you must install gphoto and v4l2loopback-utils.

sudo apt-get install gphoto2 v4l2loopback-utils

Plug in your camera via USB. Then run gphoto2 --abilities to see if your camera is capable of doing this. Here's the output when connecting a Canon EOS 1200D

enter image description here

Then run sudo modprobe v4l2loopback to activate the kernel module needed to create a video device from your camera.

I've seen older tutorials on this task that use gst-launch-0.10 to achieve the next step of this task (e.g. this one). I am using Ubuntu 17.04 which uses gst-launch-1.0. Below is the updated command to create a video device from your digital camera:

gphoto2 --stdout --capture-movie | gst-launch-1.0 fdsrc ! decodebin3 name=dec ! queue ! videoconvert ! v4l2sink device=/dev/video1

This will create a video device in /dev/video1, which you can now use in programs like VLC.

If you see any errors about the device being in use you need to kill the gvfs-gphoto2-volume-monitor process by running killall gvfs-gphoto2-volume-monitor.

  • 4
    I get this: ➜ ~ gphoto2 --stdout --capture-movie | gst-launch-1.0 fdsrc ! decodebin3 name=dec ! queue ! videoconvert ! v4l2sink device=/dev/video1 Setting pipeline to PAUSED ... Nehme Vorschaubilder als Film in 'stdout' auf. Drücke Ctrl-C zum abbrechen. ERROR: Pipeline doesn't want to pause. ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: »/dev/video1« ist kein Wiedergabegerät. Additional debug info: v4l2_calls.c(642): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Capabilities: 0x5200001 Setting pipeline to NULL ... Freeing pipeline ... – noreabu Nov 4 '17 at 10:57
  • @noreabu sounds like a bug that you should report – hellocatfood Nov 4 '17 at 19:32
  • Try /dev/video2 – danger89 Dec 2 '18 at 21:34
  • This worked via the ffmpeg answer above. I had to use guvcview to see the output – Jonathan 6 hours ago

I was able to get video & image recording with a Canon DSLR 600D

sudo apt get install guvcview ffmpeg gphoto2 v4l2loopback-dkms v4l2loopback-utils ffmpeg

Plug in camera, any mode seemed to work, test with the basics:


sudo modprobe v4l2loopback
killall gvfs-gphoto2-volume-monitor


gphoto2 --auto-detect
LANG=C gphoto2 --summary
LANG=C gphoto2 --list-all-config


gphoto2 --capture-image
gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video1

Visualize (in another terminal)




You can try different /dev/video1 commands

There's also EOS Movie Recorder

Unzip this: https://sourceforge.net/projects/eos-movrec/files/eos-movrec/0.3.3_beta/eos-movrec-0.3.3_beta.zip/download

cd eos-movrec-0.3.2_beta
sudo apt install libgphoto2-dev                                     
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..

I wanted to do that once to set up a basic webcam to see what my animals did all day while away at work, lol. You might have to set up streaming with vlc.


  • Your answer/the link doesn't actually address the specific problems. – hellocatfood Dec 4 '17 at 16:16

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.