Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v4l2loopback not found in /lib/modules/4.14.98-imx #106

Open
tobe2bcon opened this issue Jan 21, 2022 · 1 comment
Open

v4l2loopback not found in /lib/modules/4.14.98-imx #106

tobe2bcon opened this issue Jan 21, 2022 · 1 comment
Assignees

Comments

@tobe2bcon
Copy link

tobe2bcon commented Jan 21, 2022

  • Doc you were trying to follow

I have a USB camera connected to the coral dev board and I would like to convert the mjpeg video stream to H.264 in order to use this new stream in frigate, which is also running on the device. To do so, I need v4l2server (already running) and v4lsloopback (still failing). Some documents as well as terminal output say, that kernel headers are required.

  • Your host OS: <bullseye/sid, Linux version 5.4.0-96-generic>
  • Your Python3 version: <3.7.3>

What I ran

Installation of v4l2loopback:

`sudo apt-get install v4l2loopback-dkms

sudo apt-get install v4l2loopback-utils`

v4l2loopback must have been installed anyhow:

`sudo find -name v4l2loopb*

./var/lib/dkms/v4l2loopback
./var/lib/dpkg/info/v4l2loopback-dkms.postinst
./var/lib/dpkg/info/v4l2loopback-dkms.list
./var/lib/dpkg/info/v4l2loopback-dkms.md5sums
./var/lib/dpkg/info/v4l2loopback-utils.md5sums
./var/lib/dpkg/info/v4l2loopback-utils.list
./var/lib/dpkg/info/v4l2loopback-dkms.prerm
./var/cache/apt/archives/v4l2loopback-utils_0.12.1-1_all.deb
./var/cache/apt/archives/v4l2loopback-dkms_0.12.1-1_all.deb
./usr/bin/v4l2loopback-ctl
./usr/src/v4l2loopback-0.12.1
./usr/src/v4l2loopback-0.12.1/v4l2loopback_formats.h
./usr/src/v4l2loopback-0.12.1/v4l2loopback.c
./usr/share/man/man1/v4l2loopback-ctl.1.gz
./usr/share/doc/v4l2loopback-utils
./usr/share/doc/v4l2loopback-dkms
./lib/modules/4.14.98-imx/v4l2loopback`

To activate the module I further ran:

`sudo modprobe v4l2loopback

modprobe: FATAL: Module v4l2loopback not found in directory /lib/modules/4.14.98-imx`

and
`sudo dkms autoinstall

Error! echo
Your kernel headers for kernel 4.14.98-imx cannot be found at
/lib/modules/4.14.98-imx/build or /lib/modules/4.14.98-imx/source`

What the docs said should happen

no docs available / couldn't find any

What actually happened

see terminal prompts above

Open questions:

Am I simply facing an issue with the PATH environment or do I really have to recompile the kernel?
If so: Where do I get the kernel-headers from?
Has anyone faced the same issue and found a solution to resolve it?

Thanky you for any advice
Thomas

@gszakacs
Copy link

I am getting 15ms inference time, but 50-70% CPU usage when taking an MJPEG stream from a low resolution (640x80) DIY ESP32 IP cam and re-encoding the stream to h264 and feeding that to frigate. This works ok for one cam, but I gave up on this idea since I need to run object detection on 4 streams. The issue with re-encoding is that the coral dev board does not have hw encoder. See spec sheet https://coral.ai/static/files/Coral-Dev-Board-datasheet.pdf
and https://docs.frigate.video/configuration/camera_specific/

The following example was working with my webcam at <20% CPU usage, and ~10ms inference times, but I don't think there is any re-encoding involved: https://coral.ai/docs/dev-board/camera/#view-with-a-streaming-server

Other than storage/bandwith, is there a reason why the mjpeg stream must be reencoded to h264 for recording and rtmp roles in frigate ?

I am not sure how well is hw accelerated video decoding supported on the default Mendel image and using ffmpeg. Can the lack of video decoding support be the reason why I see more video processing examples utilizing gstreamer ? Any idea how difficult it would be to change frigate to use gstreamer instead of ffmpeg ?
https://github.com/google-coral/examples-camera/tree/master/gstreamer

You may find some useful info here about the iMX8m and hw accel for video decoding:
https://boundarydevices.com/zeus-yocto-release-for-i-mx8mq/
GPU Vivante libraries 6.2.4p4.0
VPU Hantro libraries v1.11.0
GStreamer1.0 1.14.4 for i.MX

Finally, if you are thinking of implementing local object detection and NVR, you may also want to consider the ideas here: https://community.home-assistant.io/t/person-detection-with-blue-iris-google-coral-and-frigate-v0-8-0/254747

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants