zanco
Posts: 24
Joined: Fri Dec 07, 2012 1:38 pm

v4lsloopback what did I do (wrong)

Sun Jul 03, 2016 10:28 am

Hi,
I am transmitting SSDV (Slow Scan Digital Video) with a Raspberry Pi. Usually the Pi grabs an image from the USB webcam or the PiCam but at home I have not that nice view as I have from an IP camera @ 52 meter heigh.

So, I did look to fake the /dev/video0 with jpg images.
I did install v4l2loopback, had to build kernal header files or something like that to succeed, tried a lot of options how to send images to the fake /dev/video0 which was made after running sudo modprobe v4l2loopback and finally ended up with a very simple

sudo copy snap.jpg /dev/video0 solution.

Made a script with the grab of snap.jpg and the file copy and had it run for more as 24 hours with no problem.

Then I did have to Sudo Halt the Pi to add the GPS board so the software could transmit my actual GPS position.

After powering up the Pi again there still is a /dev/video0 (which is removed after modprobe -r v4l2loopback and then made again with the modprobe command) but I cannot copy to /dev/video0 anymore.

I am rewarded with an error message:
cp: error writing ‘/dev/video0’: Invalid argument
cp: failed to extend ‘/dev/video0’: Invalid argument
I assume that in my experimental stage I did run a command which made it actually possible to copy jpg to /dev/video0 but I have no clue which of the many commands I tried whould be the right one.

Anyone who can help me ?

Thanks,
Ben

zanco
Posts: 24
Joined: Fri Dec 07, 2012 1:38 pm

Solved / Re: v4lsloopback what did I do (wrong)

Sun Jul 03, 2016 1:22 pm

I helped myself....

The solution is very simple.
For me, don't use the "modprobe v4l2loopback" because that generates a /dev/video0 where I cannot copy to.

After a reboot, I confirmed with LSMOD |grep v4l2* that it was not loaded.

Then I can use "sudo cp snap.jpg /dev/video0" and then there suddenly is a folder /dev/video0 where the software suddenly realises that a webcam has been attached and it starts transmitting my image.

I can copy a new file each hour and the software transmits the new image every hour.

So, case closed....

Return to “Camera board”