sudo apt-get install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-bad1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-libav gstreamer1.0-tools gstreamer1.0-x gstreamer1.0-alsa gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gstreamer1.0-pulseaudio
More info here - https://gstreamer.freedesktop.org/documentation/installing/on-linux.html?gi-language=c
dmesg | grep 16MP
Output:
[ 3.331850] usb 1-1.2: Product: 16MP USB Camera
[ 3.336472] usb 1-1.2: Manufacturer: 16MP Camera Mamufacture
[ 10.805018] usb 1-1.2: Found UVC 1.00 device 16MP USB Camera (32e4:0298)
[ 10.825348] input: 16MP USB Camera: 16MP USB Camer as /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input0
sudo apt-get install v4l-utils
v4l2-ctl --list-devices
sudo media-ctl --device /dev/media4 -p
v4l2-ctl Command Examples in Linux - https://www.thegeekdiary.com/v4l2-ctl-command-examples-in-linux/ Get all info
sudo v4l2-ctl --device=/dev/video0 --all
Get supported pixel formats
sudo v4l2-ctl -d /dev/video0 --list-formats
List supported video formats, FPS and resolutions of a specific video device
sudo v4l2-ctl --list-formats-ext --device /dev/video0
fswebcam -r 4656х3496 --no-banner image1.jpg
More info here - https://raspberrypi-guide.github.io/electronics/using-usb-webcams
v4l2-ctl --device path/to/video_device --set-fmt-video=width=width,height=height,pixelformat=MJPG --stream-mmap --stream-to=path/to/output.jpg --stream-count=1
0. sudo apt-get install modion
1. create separate user to escape permossion denied error - https://raspberrypi.stackexchange.com/questions/78715/motion-daemon-var-log-motion-motion-log-permission-denied
2. Google default config file for your version of motion. Change parameters which you need here - sudo nano /etc/motion/motion.conf
3. For better performance use this - https://raspberrypi.stackexchange.com/questions/106078/very-slow-with-motion-server-raspberry-pi-b
4. Setup camera setting here - /etc/motion/camera1-dist.conf
5. sudo service motion start
More info:
- https://motion-project.github.io/motion_guide.html
- https://youtu.be/p1An7l0PY2M?si=vhispsp-E1l4YTY-
- https://www.instructables.com/Raspberry-Pi-remote-webcam/
- https://habr.com/ru/articles/424191/
Start UDP stream from RPI
HOST=192.168.1.101
PORT=5602
gst-launch-1.0 -v v4l2src device=/dev/video0 ! image/jpeg,width=1920,height=1080,type=video,framerate=30/1 ! jpegdec ! videoscale ! videoconvert ! x264enc tune=zerolatency ! rtph264pay ! udpsink host=$HOST port=$PORT
Show the stream on host:
PORT=5602
gst-launch-1.0 udpsrc port=$PORT caps = "application/x-rtp, media=video, clock-rate=90000, encoding-name=H264, payload=96" ! rtph264depay ! avdec_h264 ! autovideosink
sudo media-ctl --device /dev/media4 --set-v4l2 '"Input 1":0[fmt:MJPG/1920x1080@1/30]'. <---- DON'T WORK
sudo v4l2-ctl -d /dev/video0 --set-fmt-video=width=4656,height=3496,pixelformat=MJPG -p 10
-p 10 means 10fps
https://www.marcusfolkesson.se/blog/v4l2-and-media-controller/ https://gist.github.com/anselmobattisti/ddab81f9485c5479d6c784d2813bc28e https://gist.github.com/hum4n0id/cda96fb07a34300cdb2c0e314c14df0a#send-a-webcam-with-h264-rtp-streamjetson-nano