-
Notifications
You must be signed in to change notification settings - Fork 4
/
wsl2_usb_camera.txt
27 lines (27 loc) · 1.52 KB
/
wsl2_usb_camera.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
######################
# Build WSL2 kernel with usb camera support
# menuconfig -> Device Drivers -> Multimedia support -> Filter media drivers
# -> Device Drivers -> Multimedia support -> Media device types -> Cameras and video grabbers
# -> Device Drivers -> Multimedia support -> Video4Linux options -> V4L2 sub-device userspace API
# -> Device Drivers -> Multimedia support -> Media drivers -> Media USB Adapters -> USB Video Class (UVC)
# -> Device Drivers -> Multimedia support -> Media drivers -> Media USB Adapters -> UVC input events device support
# -> Device Drivers -> Multimedia support -> Media drivers -> Media USB Adapters -> GSPCA based webcams
######################
VERSION=5.15.57.1
sudo apt update && sudo apt upgrade -y && sudo apt install -y build-essential flex bison libgtk2.0-dev libelf-dev libncurses-dev autoconf libudev-dev libtool zip unzip v4l-utils libssl-dev python3-pip cmake git iputils-ping net-tools dwarves
sudo mkdir /usr/src
cd /usr/src
sudo git clone -b linux-msft-wsl-${VERSION} https://github.com/microsoft/WSL2-Linux-Kernel.git ${VERSION}-microsoft-standard && cd ${VERSION}-microsoft-standard
sudo cp /proc/config.gz config.gz
sudo gunzip config.gz
sudo mv config .config
sudo make menuconfig
sudo make -j$(nproc)
sudo make modules_install -j$(nproc)
sudo make install -j$(nproc)
sudo cp -rf vmlinux /mnt/c/Sources/
######################
# Record video in WSL
######################
sudo apt install v4l-utils guvcview
sudo guvcview