Celeb Glow
news | March 27, 2026

18.04 ffmpeg: Play mp4 on fake webcam, "Conversion Failed!"

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.

1

1 Answer

I ran into the exact same issue a while ago.

In short, you need to update the driver from the latest sources at and recompile the module.

Don't forget to remove the stock v4l2loopback_dkms driver!

For more information on the topic, look for instance at:

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy