'FFMPEG -stream_loop from a .mp4 file displays a distorted output (virtual webcam/fake cam) Linux Mint

Can someone please tell me why this command works with a .mkv file:

ffmpeg -stream_loop -1 -re -i /home/roku33/Desktop/s.mkv -vcodec rawvideo -threads 0 -f v4l2 /dev/video2

But when I switch the input file to s.mp4, it breaks and shows up distorted? I'm on Linux Mint. I assume it is a codec issue and I need to change the command. I am obviously a noob here but please know that I spent 14 hours to get this far yesterday, I have searched endlessly. I understand the answer is likely here somewhere.

Thank you in advance.



Solution 1:[1]

ffmpeg -re -stream_loop -1 -i /home/roku33/Desktop/a3.mp4 -vcodec rawvideo -threads 0 -f v4l2 /dev/video2

This is finally what ended up working.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 user18940401