added lshw

This commit is contained in:
cpu
2024-01-03 23:51:50 +01:00
parent e1bec7a086
commit 5b126aa4fb

View File

@@ -108,6 +108,22 @@ card 1: Q9000 [QuickCam Pro 9000], device 0: USB Audio [USB Audio]
> `ffmpeg -loglevel error -i rtsp://garagecam.virtonline.eu:554/live3.sdp -c copy -f flv rtmp://peertube.virtonline.eu:1935/live/LIVE-STREAM-KEY` > `ffmpeg -loglevel error -i rtsp://garagecam.virtonline.eu:554/live3.sdp -c copy -f flv rtmp://peertube.virtonline.eu:1935/live/LIVE-STREAM-KEY`
### Live stream camera using h.264 hardware acceleration [VAAPI](https://trac.ffmpeg.org/wiki/Hardware/VAAPI) (e.g. on Intel iGPU) ### Live stream camera using h.264 hardware acceleration [VAAPI](https://trac.ffmpeg.org/wiki/Hardware/VAAPI) (e.g. on Intel iGPU)
Check your GPU
> `sudo lshw -C display`
```
*-display
description: VGA compatible controller
product: Skylake GT2 [HD Graphics 520]
vendor: Intel Corporation
physical id: 2
bus info: pci@0000:00:02.0
version: 07
width: 64 bits
clock: 33MHz
capabilities: pciexpress msi pm vga_controller bus_master cap_list rom
configuration: driver=i915 latency=0
resources: irq:134 memory:de000000-deffffff memory:c0000000-cfffffff ioport:f000(size=64) memory:c0000-dffff
```
Use the dockerized ffmpeg with precompiled vaapi support, adjust `/dev/video2` Use the dockerized ffmpeg with precompiled vaapi support, adjust `/dev/video2`
> `alias ffmpeg='docker run --rm -w $(pwd) -v $(pwd):$(pwd) --device=/dev/dri --device=/dev/video2 jrottenberg/ffmpeg:vaapi'` > `alias ffmpeg='docker run --rm -w $(pwd) -v $(pwd):$(pwd) --device=/dev/dri --device=/dev/video2 jrottenberg/ffmpeg:vaapi'`
@@ -115,7 +131,7 @@ Adjust `/dev/video2`, `-video_size 1920x1080 -framerate 60` and stream to peertu
> `ffmpeg -hide_banner -y -f v4l2 -input_format mjpeg -video_size 1920x1080 -framerate 60 -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /dev/video2 -vf 'scale_vaapi=format=nv12' -c:v h264_vaapi -b:v 10M -f flv rtmp://peertube.virtonline.eu:1935/live/LIVE-STREAM-KEY` > `ffmpeg -hide_banner -y -f v4l2 -input_format mjpeg -video_size 1920x1080 -framerate 60 -hwaccel vaapi -hwaccel_device /dev/dri/renderD128 -hwaccel_output_format vaapi -i /dev/video2 -vf 'scale_vaapi=format=nv12' -c:v h264_vaapi -b:v 10M -f flv rtmp://peertube.virtonline.eu:1935/live/LIVE-STREAM-KEY`
### Setup a systemd service for a non-stop streaming ### Setup a systemd service for a non-stop streaming
Adapt 'video_bitrate=3500000' to your Raspberry Pi (Zero W) max upload speed Adapt 'VIDEO_BITRATE="3500000"' to your max network upload speed
``` ```
sudo tee /etc/systemd/system/webcam-streamer.service <<EOF sudo tee /etc/systemd/system/webcam-streamer.service <<EOF
[Unit] [Unit]
@@ -130,20 +146,22 @@ Type=simple
Environment="HOME=/root" Environment="HOME=/root"
Environment=PEERTUBE_LIVE="rtmp://peertube.virtonline.eu:1935/live/9671cdd4-694d-4645-8d86-30df2297eb10" Environment=PEERTUBE_LIVE="rtmp://peertube.virtonline.eu:1935/live/9671cdd4-694d-4645-8d86-30df2297eb10"
Environment=VIDEO_DEVICE="/dev/video0" Environment=VIDEO_DEVICE="/dev/video0"
Environment=VIDEO_CODEC="h264" # h264 Environment=VIDEO_CODEC="h264"
Environment=VIDEO_BITRATE="3500000" # 3500000 (3,5Mbit/s) Environment=VIDEO_BITRATE="3500000"
Environment=VIDEO_RESOLUTION="1920x1080" # 1920x1080 (Full-HD) Environment=VIDEO_RESOLUTION="1920x1080"
Environment=VIDEO_FRAMERATE="30" # 30 Environment=VIDEO_FRAMERATE="30"
ExecStartPre=-/usr/bin/env sh -c 'killall ffmpeg 2>/dev/null || true' ExecStartPre=-/usr/bin/env sh -c 'killall ffmpeg 2>/dev/null || true'
ExecStartPre=-/usr/bin/env sh -c 'v4l2-ctl -d ${VIDEO_DEVICE} -c video_bitrate=${VIDEO_BITRATE}' ExecStartPre=-/usr/bin/env sh -c 'v4l2-ctl -d ${VIDEO_DEVICE} -c video_bitrate=${VIDEO_BITRATE}'
ExecStart=/bin/bash -c 'ffmpeg -loglevel error \ ExecStart=/bin/bash -c 'ffmpeg -loglevel error \
-f v4l2 -input_format ${VIDEO_CODEC} \ -f v4l2 \
-input_format ${VIDEO_CODEC} \
-video_size ${VIDEO_RESOLUTION} \ -video_size ${VIDEO_RESOLUTION} \
-framerate ${VIDEO_FRAMERATE} \ -framerate ${VIDEO_FRAMERATE} \
-i ${VIDEO_DEVICE} \ -i ${VIDEO_DEVICE} \
-c copy -f flv \ -c copy \
-f flv \
-tune zerolatency \ -tune zerolatency \
${PEERTUBE_LIVE}' ${PEERTUBE_LIVE}'