3

What I am trying to achive is to redirect my camera /dev/video0 with a custom video file.

Desired Reasult:

When opened a application like cheese or websites like jitsi which process the buffer from my camera. Is it possible to use already captured video file as camera input.

Previous attempt:

I followed a answer from this answer but i am getting a error message as

[video4linux2,v4l2 @ 0x556927267880] 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!

on executing the command

ffmpeg -re -i ~/Videos/Webcam/sample.webm -map 0:v -f v4l2 /dev/video0
Dev-il
  • 51

1 Answers1

1

I just solved after a couple of hours. On this answer the /dev/video0 was actually representing the virtual camera created by v4l2loopback but in my case as I am on laptop /dev/video0 actually points to integrated webcam. So what I did is:

ls /dev/video*

And note the devices returned now you can load the module like

sudo modprobe v4l2loopback

and now a new device pointer should be preset. Check it by

ls /dev/video*

Notice the new device added and that's what you have to work with. Keeping this in mind now you can follow this thread.

Pablo Bianchi
  • 17,371
Dev-il
  • 51