@@ -76,30 +76,11 @@ services:
76
76
NEKO_WEBRTC_NAT1TO1 : <your-IP>
77
77
` ` `
78
78
79
- ## Raspberry Pi {#raspberry-pi}
80
-
81
- ` ` ` yaml title="config.yaml"
82
- capture :
83
- video :
84
- codec : h264
85
- ids : [ main ]
86
- pipelines :
87
- main :
88
- gst_pipeline : |
89
- ximagesrc display-name=%s use-damage=0 show-pointer=true use-damage=false
90
- ! video/x-raw,framerate=30/1
91
- ! videoconvert
92
- ! queue
93
- ! video/x-raw,framerate=30/1,format=NV12
94
- ! v4l2h264enc extra-controls="controls,h264_profile=1,video_bitrate=1250000;"
95
- ! h264parse config-interval=3
96
- ! video/x-h264,stream-format=byte-stream,profile=constrained-baseline
97
- ` ` `
79
+ ## Raspberry Pi GPU Acceleration {#raspberry-pi}
98
80
99
81
` ` ` yaml title="docker-compose.yaml"
100
82
services :
101
83
neko :
102
- # see docs for more variants
103
84
image : " ghcr.io/m1k1o/neko/chromium:latest"
104
85
restart : " unless-stopped"
105
86
# increase on rpi's with more then 1gb ram.
@@ -110,12 +91,121 @@ services:
110
91
# note: this is important since we need a GPU for hardware acceleration alternatively
111
92
# mount the devices into the docker.
112
93
privileged : true
113
- volumes :
114
- - " ./config.yaml:/etc/neko/neko.yaml"
115
94
environment :
95
+ NEKO_CAPTURE_VIDEO_PIPELINE : |
96
+ ximagesrc display-name={display} show-pointer=true use-damage=false
97
+ ! video/x-raw,framerate=25/1
98
+ ! videoconvert ! queue
99
+ ! video/x-raw,format=NV12
100
+ ! v4l2h264enc
101
+ name=encoder
102
+ extra-controls="controls,h264_profile=1,video_bitrate=1250000;"
103
+ ! h264parse config-interval=-1
104
+ ! video/x-h264,stream-format=byte-stream
105
+ ! appsink name=appsink
106
+ NEKO_CAPTURE_VIDEO_CODEC : " h264"
116
107
NEKO_DESKTOP_SCREEN : ' 1280x720@30'
117
- NEKO_MEMBER_MULTIUSER_USER_PASSWORD : ' neko'
118
- NEKO_MEMBER_MULTIUSER_ADMIN_PASSWORD : ' admin'
108
+ NEKO_MEMBER_MULTIUSER_USER_PASSWORD : neko
109
+ NEKO_MEMBER_MULTIUSER_ADMIN_PASSWORD : admin
110
+ NEKO_WEBRTC_EPR : 52000-52100
111
+ NEKO_WEBRTC_ICELITE : 1
112
+ ` ` `
113
+
114
+ ## Nvidia GPU Acceleration {#nvidia}
115
+
116
+ Neko supports hardware acceleration using Nvidia GPUs. To use this feature, you need to have the Nvidia Container Toolkit installed on your system. You can find the installation instructions [here](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/install-guide.html).
117
+
118
+ This example shows how to accelerate video encoding and as well the browser rendering using the GPU. You can test if the GPU is used by running ` nvidia-smi`, which should show the GPU usage of both the browser and neko. In the browser, you can run the [WebGL Aquarium Demo](https://webglsamples.org/aquarium/aquarium.html) to test the GPU usage.
119
+
120
+ ` ` ` yaml title="docker-compose.yaml"
121
+ services:
122
+ neko:
123
+ image: "ghcr.io/m1k1o/neko/nvidia-firefox:latest"
124
+ restart: "unless-stopped"
125
+ shm_size: "2gb"
126
+ ports:
127
+ - "8080:8080"
128
+ - "52000-52100:52000-52100/udp"
129
+ environment:
130
+ NEKO_CAPTURE_VIDEO_PIPELINE: |
131
+ ximagesrc display-name={display} show-pointer=true use-damage=false
132
+ ! video/x-raw,framerate=25/1
133
+ ! videoconvert ! queue
134
+ ! video/x-raw,format=NV12
135
+ ! nvh264enc
136
+ name=encoder
137
+ preset=2
138
+ gop-size=25
139
+ spatial-aq=true
140
+ temporal-aq=true
141
+ bitrate=4096
142
+ vbv-buffer-size=4096
143
+ rc-mode=6
144
+ ! h264parse config-interval=-1
145
+ ! video/x-h264,stream-format=byte-stream
146
+ ! appsink name=appsink
147
+ NEKO_CAPTURE_VIDEO_CODEC: "h264"
148
+ NEKO_DESKTOP_SCREEN: 1920x1080@30
149
+ NEKO_MEMBER_MULTIUSER_USER_PASSWORD: neko
150
+ NEKO_MEMBER_MULTIUSER_ADMIN_PASSWORD: admin
151
+ NEKO_WEBRTC_EPR: 52000-52100
152
+ NEKO_WEBRTC_ICELITE: 1
153
+ deploy:
154
+ resources:
155
+ reservations:
156
+ devices:
157
+ - driver: nvidia
158
+ count: 1
159
+ capabilities: [gpu]
160
+ ` ` `
161
+
162
+ See available [Nvidia Docker Images](/docs/v3/installation/docker-images#nvidia).
163
+
164
+ If you only want to accelerate the encoding, **not the browser rendering**, you can use the default image with additional environment variables :
165
+
166
+ ` ` ` yaml title="docker-compose.yaml"
167
+ services:
168
+ neko:
169
+ # highlight-next-line
170
+ image: "ghcr.io/m1k1o/neko/firefox:latest"
171
+ restart: "unless-stopped"
172
+ shm_size: "2gb"
173
+ ports:
174
+ - "8080:8080"
175
+ - "52000-52100:52000-52100/udp"
176
+ environment:
177
+ # highlight-start
178
+ NVIDIA_VISIBLE_DEVICES: all
179
+ NVIDIA_DRIVER_CAPABILITIES: all
180
+ # highlight-end
181
+ NEKO_CAPTURE_VIDEO_PIPELINE: |
182
+ ximagesrc display-name={display} show-pointer=true use-damage=false
183
+ ! video/x-raw,framerate=25/1
184
+ ! videoconvert ! queue
185
+ ! video/x-raw,format=NV12
186
+ ! nvh264enc
187
+ name=encoder
188
+ preset=2
189
+ gop-size=25
190
+ spatial-aq=true
191
+ temporal-aq=true
192
+ bitrate=4096
193
+ vbv-buffer-size=4096
194
+ rc-mode=6
195
+ ! h264parse config-interval=-1
196
+ ! video/x-h264,stream-format=byte-stream
197
+ ! appsink name=appsink
198
+ NEKO_CAPTURE_VIDEO_CODEC: "h264"
199
+ NEKO_DESKTOP_SCREEN: 1920x1080@30
200
+ NEKO_MEMBER_MULTIUSER_USER_PASSWORD: neko
201
+ NEKO_MEMBER_MULTIUSER_ADMIN_PASSWORD: admin
119
202
NEKO_WEBRTC_EPR: 52000-52100
120
203
NEKO_WEBRTC_ICELITE: 1
204
+ deploy:
205
+ resources:
206
+ reservations:
207
+ devices:
208
+ - driver: nvidia
209
+ count: 1
210
+ capabilities: [gpu]
121
211
` ` `
0 commit comments