Recently we just installed our traffic counting and trespassing system at the grade-crossing location. One thing we didn’t expect was that both live feed program and analysis program will require camera data, but they cannot do it at the same time. How to copy the camera device with efficiency becomes a problem.
Hopefully we have the great kernel module v4l2loopback which can create loop back devices. Then we use ffmpeg to pipe real camera into 2 separate virtual video devices to achieve concurrency.
One tricky part is since we are using nvidia jetson, it’s ubuntu is customized, so you need to build some header modules first.
Then the v4l2loopback can be built successfully.