2

Trying to create a new fake webcam device (/dev/video2) and play a video on it so I can use it as a virtual webcam.

Steps I took:

sudo apt-get install v4l2loopback-dkms
sudo modprobe v4l2loopback
sudo depmod -a

ffmpeg -i vid1.mp4 -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video2

The error from the ffmpeg command:

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!

No idea what to do.

Zanna
  • 72,312

1 Answers1

1

I ran into the exact same issue a while ago.

In short, you need to update the driver from the latest sources at https://github.com/umlaeute/v4l2loopback and recompile the module.

Don't forget to remove the stock v4l2loopback_dkms driver!

For more information on the topic, look for instance at: https://github.com/umlaeute/v4l2loopback/issues/247