edge-impulse-linux 1.3.7 → 1.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,10 @@
1
1
  import assert from "assert";
2
- import { GStreamer } from "../library/sensors/gstreamer";
3
- import { SpawnHelperType } from "../library/sensors/spawn-helper";
2
+ import {
3
+ GStreamer
4
+ } from "../library/sensors/gstreamer";
5
+ import {
6
+ SpawnHelperType
7
+ } from "../library/sensors/spawn-helper";
4
8
 
5
9
  describe("gstreamer", () => {
6
10
  describe("parse devices", () => {
@@ -121,8 +125,7 @@ GST_ARGUS: Done Success
121
125
  assert.equal(devices.length, 1);
122
126
  assert.equal(devices[0].id, 'nvarguscamerasrc');
123
127
  assert.equal(devices[0].name, 'CSI camera');
124
- assert.equal(JSON.stringify(devices[0].caps), JSON.stringify([
125
- {
128
+ assert.equal(JSON.stringify(devices[0].caps), JSON.stringify([{
126
129
  framerate: 21,
127
130
  height: 2464,
128
131
  width: 3264,
@@ -161,6 +164,334 @@ GST_ARGUS: Done Success
161
164
  ]));
162
165
  });
163
166
 
167
+ // Tested locally (Jan)
168
+ it("nvidia jetson w/ Logitech C922", async () => {
169
+ const gstOutput = `Probing devices...
170
+
171
+
172
+ Device found:
173
+
174
+ name : C922 Pro Stream Webcam Analog Stereo
175
+ class : Audio/Source
176
+ caps : audio/x-raw, format=(string){ S16LE, S16BE, F32LE, F32BE, S32LE, S32BE, S24LE, S24BE, S24_32LE, S24_32BE, U8 }, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 32 ];
177
+ audio/x-alaw, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 32 ];
178
+ audio/x-mulaw, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 32 ];
179
+ properties:
180
+ alsa.resolution_bits = 16
181
+ device.api = alsa
182
+ device.class = sound
183
+ alsa.class = generic
184
+ alsa.subclass = generic-mix
185
+ alsa.name = "USB\ Audio"
186
+ alsa.id = "USB\ Audio"
187
+ alsa.subdevice = 0
188
+ alsa.subdevice_name = "subdevice\ \#0"
189
+ alsa.device = 0
190
+ alsa.card = 2
191
+ alsa.card_name = "C922\ Pro\ Stream\ Webcam"
192
+ alsa.long_card_name = "C922\ Pro\ Stream\ Webcam\ at\ usb-70090000.xusb-2.1\,\ high\ speed"
193
+ alsa.driver_name = snd_usb_audio
194
+ device.bus_path = platform-70090000.xusb-usb-0:2.1:1.2
195
+ sysfs.path = /devices/70090000.xusb/usb1/1-2/1-2.1/1-2.1:1.2/sound/card2
196
+ udev.id = usb-046d_C922_Pro_Stream_Webcam_C72F6EDF-02
197
+ device.bus = usb
198
+ device.vendor.id = 046d
199
+ device.vendor.name = "Logitech\,\ Inc."
200
+ device.product.id = 085c
201
+ device.product.name = "C922\ Pro\ Stream\ Webcam"
202
+ device.serial = 046d_C922_Pro_Stream_Webcam_C72F6EDF
203
+ device.form_factor = webcam
204
+ device.string = front:2
205
+ device.buffering.buffer_size = 256000
206
+ device.buffering.fragment_size = 128000
207
+ device.access_mode = mmap+timer
208
+ device.profile.name = analog-stereo
209
+ device.profile.description = "Analog\ Stereo"
210
+ device.description = "C922\ Pro\ Stream\ Webcam\ Analog\ Stereo"
211
+ alsa.mixer_name = "USB\ Mixer"
212
+ alsa.components = USB046d:085c
213
+ module-udev-detect.discovered = 1
214
+ device.icon_name = camera-web-usb
215
+ gst-launch-1.0 pulsesrc device=alsa_input.usb-046d_C922_Pro_Stream_Webcam_C72F6EDF-02.analog-stereo ! ...
216
+
217
+
218
+ Device found:
219
+
220
+ name : Monitor of Built-in Audio Analog Stereo
221
+ class : Audio/Source
222
+ caps : audio/x-raw, format=(string){ S16LE, S16BE, F32LE, F32BE, S32LE, S32BE, S24LE, S24BE, S24_32LE, S24_32BE, U8 }, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 32 ];
223
+ audio/x-alaw, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 32 ];
224
+ audio/x-mulaw, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 32 ];
225
+ properties:
226
+ device.description = "Monitor\ of\ Built-in\ Audio\ Analog\ Stereo"
227
+ device.class = monitor
228
+ alsa.card = 1
229
+ alsa.card_name = tegra-snd-t210ref-mobile-rt565x
230
+ alsa.long_card_name = tegra-snd-t210ref-mobile-rt565x
231
+ device.bus_path = platform-sound
232
+ sysfs.path = /devices/sound/sound/card1
233
+ device.form_factor = internal
234
+ device.string = 1
235
+ module-udev-detect.discovered = 1
236
+ device.icon_name = audio-card
237
+ gst-launch-1.0 pulsesrc device=alsa_output.platform-sound.analog-stereo.monitor ! ...
238
+
239
+
240
+ Device found:
241
+
242
+ name : Built-in Audio Analog Stereo
243
+ class : Audio/Source
244
+ caps : audio/x-raw, format=(string){ S16LE, S16BE, F32LE, F32BE, S32LE, S32BE, S24LE, S24BE, S24_32LE, S24_32BE, U8 }, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 32 ];
245
+ audio/x-alaw, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 32 ];
246
+ audio/x-mulaw, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 32 ];
247
+ properties:
248
+ alsa.resolution_bits = 16
249
+ device.api = alsa
250
+ device.class = sound
251
+ alsa.class = generic
252
+ alsa.subclass = generic-mix
253
+ alsa.name = ""
254
+ alsa.id = "ADMAIF1\ CIF\ ADMAIF1-0"
255
+ alsa.subdevice = 0
256
+ alsa.subdevice_name = "subdevice\ \#0"
257
+ alsa.device = 0
258
+ alsa.card = 1
259
+ alsa.card_name = tegra-snd-t210ref-mobile-rt565x
260
+ alsa.long_card_name = tegra-snd-t210ref-mobile-rt565x
261
+ device.bus_path = platform-sound
262
+ sysfs.path = /devices/sound/sound/card1
263
+ device.form_factor = internal
264
+ device.string = front:1
265
+ device.buffering.buffer_size = 32768
266
+ device.buffering.fragment_size = 16384
267
+ device.access_mode = mmap+timer
268
+ device.profile.name = analog-stereo
269
+ device.profile.description = "Analog\ Stereo"
270
+ device.description = "Built-in\ Audio\ Analog\ Stereo"
271
+ module-udev-detect.discovered = 1
272
+ device.icon_name = audio-card
273
+ gst-launch-1.0 pulsesrc device=alsa_input.platform-sound.analog-stereo ! ...
274
+
275
+
276
+ Device found:
277
+
278
+ name : Built-in Audio Analog Stereo
279
+ class : Audio/Sink
280
+ caps : audio/x-raw, format=(string){ S16LE, S16BE, F32LE, F32BE, S32LE, S32BE, S24LE, S24BE, S24_32LE, S24_32BE, U8 }, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 32 ];
281
+ audio/x-alaw, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 32 ];
282
+ audio/x-mulaw, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 32 ];
283
+ properties:
284
+ alsa.resolution_bits = 16
285
+ device.api = alsa
286
+ device.class = sound
287
+ alsa.class = generic
288
+ alsa.subclass = generic-mix
289
+ alsa.name = ""
290
+ alsa.id = "ADMAIF1\ CIF\ ADMAIF1-0"
291
+ alsa.subdevice = 0
292
+ alsa.subdevice_name = "subdevice\ \#0"
293
+ alsa.device = 0
294
+ alsa.card = 1
295
+ alsa.card_name = tegra-snd-t210ref-mobile-rt565x
296
+ alsa.long_card_name = tegra-snd-t210ref-mobile-rt565x
297
+ device.bus_path = platform-sound
298
+ sysfs.path = /devices/sound/sound/card1
299
+ device.form_factor = internal
300
+ device.string = front:1
301
+ device.buffering.buffer_size = 32768
302
+ device.buffering.fragment_size = 16384
303
+ device.access_mode = mmap+timer
304
+ device.profile.name = analog-stereo
305
+ device.profile.description = "Analog\ Stereo"
306
+ device.description = "Built-in\ Audio\ Analog\ Stereo"
307
+ module-udev-detect.discovered = 1
308
+ device.icon_name = audio-card
309
+ gst-launch-1.0 ... ! pulsesink device=alsa_output.platform-sound.analog-stereo
310
+
311
+
312
+ Device found:
313
+
314
+ name : C922 Pro Stream Webcam
315
+ class : Video/Source
316
+ caps : video/x-raw, format=(string)YUY2, width=(int)2304, height=(int)1536, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)2/1;
317
+ video/x-raw, format=(string)YUY2, width=(int)2304, height=(int)1296, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)2/1;
318
+ video/x-raw, format=(string)YUY2, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)5/1;
319
+ video/x-raw, format=(string)YUY2, width=(int)1600, height=(int)896, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 15/2, 5/1 };
320
+ video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 10/1, 15/2, 5/1 };
321
+ video/x-raw, format=(string)YUY2, width=(int)960, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 15/1, 10/1, 15/2, 5/1 };
322
+ video/x-raw, format=(string)YUY2, width=(int)1024, height=(int)576, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 15/1, 10/1, 15/2, 5/1 };
323
+ video/x-raw, format=(string)YUY2, width=(int)800, height=(int)600, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
324
+ video/x-raw, format=(string)YUY2, width=(int)864, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
325
+ video/x-raw, format=(string)YUY2, width=(int)800, height=(int)448, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
326
+ video/x-raw, format=(string)YUY2, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
327
+ video/x-raw, format=(string)YUY2, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
328
+ video/x-raw, format=(string)YUY2, width=(int)432, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
329
+ video/x-raw, format=(string)YUY2, width=(int)352, height=(int)288, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
330
+ video/x-raw, format=(string)YUY2, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
331
+ video/x-raw, format=(string)YUY2, width=(int)320, height=(int)180, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
332
+ video/x-raw, format=(string)YUY2, width=(int)176, height=(int)144, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
333
+ video/x-raw, format=(string)YUY2, width=(int)160, height=(int)120, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
334
+ video/x-raw, format=(string)YUY2, width=(int)160, height=(int)90, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
335
+ image/jpeg, width=(int)1920, height=(int)1080, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
336
+ image/jpeg, width=(int)1600, height=(int)896, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
337
+ image/jpeg, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 60/1, 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
338
+ image/jpeg, width=(int)960, height=(int)720, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
339
+ image/jpeg, width=(int)1024, height=(int)576, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
340
+ image/jpeg, width=(int)800, height=(int)600, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
341
+ image/jpeg, width=(int)864, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
342
+ image/jpeg, width=(int)800, height=(int)448, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
343
+ image/jpeg, width=(int)640, height=(int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
344
+ image/jpeg, width=(int)640, height=(int)360, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
345
+ image/jpeg, width=(int)432, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
346
+ image/jpeg, width=(int)352, height=(int)288, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
347
+ image/jpeg, width=(int)320, height=(int)240, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
348
+ image/jpeg, width=(int)320, height=(int)180, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
349
+ image/jpeg, width=(int)176, height=(int)144, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
350
+ image/jpeg, width=(int)160, height=(int)120, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
351
+ image/jpeg, width=(int)160, height=(int)90, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction){ 30/1, 24/1, 20/1, 15/1, 10/1, 15/2, 5/1 };
352
+ properties:
353
+ udev-probed = true
354
+ device.bus_path = platform-70090000.xusb-usb-0:2.1:1.0
355
+ sysfs.path = /sys/devices/70090000.xusb/usb1/1-2/1-2.1/1-2.1:1.0/video4linux/video0
356
+ device.bus = usb
357
+ device.subsystem = video4linux
358
+ device.vendor.id = 046d
359
+ device.vendor.name = 046d
360
+ device.product.id = 085c
361
+ device.product.name = "C922\ Pro\ Stream\ Webcam"
362
+ device.serial = 046d_C922_Pro_Stream_Webcam_C72F6EDF
363
+ device.capabilities = :capture:
364
+ device.api = v4l2
365
+ device.path = /dev/video0
366
+ v4l2.device.driver = uvcvideo
367
+ v4l2.device.card = "C922\ Pro\ Stream\ Webcam"
368
+ v4l2.device.bus_info = usb-70090000.xusb-2.1
369
+ v4l2.device.version = 264649 (0x000409c9)
370
+ v4l2.device.capabilities = 2216689665 (0x84200001)
371
+ v4l2.device.device_caps = 69206017 (0x04200001)
372
+ gst-launch-1.0 v4l2src ! ...`;
373
+
374
+ const gstLaunchNvargusCameraSrcOutput = `Setting pipeline to PAUSED ...
375
+ Pipeline is live and does not need PREROLL ...
376
+ Setting pipeline to PLAYING ...
377
+ New clock: GstSystemClock
378
+ Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:645 No cameras available
379
+
380
+ (gst-launch-1.0:17101): GStreamer-CRITICAL **: 11:58:19.104: gst_mini_object_set_qdata: assertion 'object != NULL' failed
381
+ ^Chandling interrupt.
382
+ Interrupt: Stopping pipeline ...
383
+ Execution ended after 0:00:03.636570581
384
+ Setting pipeline to PAUSED ...
385
+ Setting pipeline to READY ...
386
+ Setting pipeline to NULL ...
387
+ Freeing pipeline ...
388
+ `;
389
+
390
+ const devices = await testGetDevices(gstOutput, gstLaunchNvargusCameraSrcOutput);
391
+
392
+ assert.equal(devices.length, 1);
393
+ assert.equal(devices[0].id, '/dev/video0');
394
+ assert.equal(devices[0].name, 'C922 Pro Stream Webcam');
395
+ assert.equal(JSON.stringify(devices[0].caps), JSON.stringify([
396
+ {
397
+ type: "video/x-raw",
398
+ width: 2304,
399
+ height: 1536,
400
+ framerate: 2
401
+ }, {
402
+ type: "video/x-raw",
403
+ width: 2304,
404
+ height: 1296,
405
+ framerate: 2
406
+ }, {
407
+ type: "video/x-raw",
408
+ width: 1920,
409
+ height: 1080,
410
+ framerate: 5
411
+ }, {
412
+ type: "video/x-raw",
413
+ width: 1600,
414
+ height: 896,
415
+ framerate: 15
416
+ }, {
417
+ type: "video/x-raw",
418
+ width: 1280,
419
+ height: 720,
420
+ framerate: 10
421
+ }, {
422
+ type: "video/x-raw",
423
+ width: 960,
424
+ height: 720,
425
+ framerate: 15
426
+ }, {
427
+ type: "video/x-raw",
428
+ width: 1024,
429
+ height: 576,
430
+ framerate: 15
431
+ }, {
432
+ type: "video/x-raw",
433
+ width: 800,
434
+ height: 600,
435
+ framerate: 24
436
+ }, {
437
+ type: "video/x-raw",
438
+ width: 864,
439
+ height: 480,
440
+ framerate: 24
441
+ }, {
442
+ type: "video/x-raw",
443
+ width: 800,
444
+ height: 448,
445
+ framerate: 30
446
+ }, {
447
+ type: "video/x-raw",
448
+ width: 640,
449
+ height: 480,
450
+ framerate: 30
451
+ }, {
452
+ type: "video/x-raw",
453
+ width: 640,
454
+ height: 360,
455
+ framerate: 30
456
+ }, {
457
+ type: "video/x-raw",
458
+ width: 432,
459
+ height: 240,
460
+ framerate: 30
461
+ }, {
462
+ type: "video/x-raw",
463
+ width: 352,
464
+ height: 288,
465
+ framerate: 30
466
+ }, {
467
+ type: "video/x-raw",
468
+ width: 320,
469
+ height: 240,
470
+ framerate: 30
471
+ }, {
472
+ type: "video/x-raw",
473
+ width: 320,
474
+ height: 180,
475
+ framerate: 30
476
+ }, {
477
+ type: "video/x-raw",
478
+ width: 176,
479
+ height: 144,
480
+ framerate: 30
481
+ }, {
482
+ type: "video/x-raw",
483
+ width: 160,
484
+ height: 120,
485
+ framerate: 30
486
+ }, {
487
+ type: "video/x-raw",
488
+ width: 160,
489
+ height: 90,
490
+ framerate: 30
491
+ }
492
+ ]));
493
+ });
494
+
164
495
  // https://forum.edgeimpulse.com/t/usb-camera-on-raspberry-pi/1758
165
496
  it("usb camera on rpi w/ image/jpeg", async () => {
166
497
  const gstOutput = `Probing devices...
@@ -344,8 +675,7 @@ Device found:
344
675
  assert.equal(devices.length, 1);
345
676
  assert.equal(devices[0].id, '/dev/video0');
346
677
  assert.equal(devices[0].name, 'i.MX6S_CSI');
347
- assert.equal(JSON.stringify(devices[0].caps), JSON.stringify([
348
- {
678
+ assert.equal(JSON.stringify(devices[0].caps), JSON.stringify([{
349
679
  type: "video/x-raw",
350
680
  width: 2592,
351
681
  height: 1944,
@@ -718,8 +1048,7 @@ Device found:
718
1048
  assert.equal(devices.length, 1);
719
1049
  assert.equal(devices[0].id, '/dev/video0');
720
1050
  assert.equal(devices[0].name, 'UvcH264 Video Capture 4 (/dev/video0)');
721
- assert.equal(JSON.stringify(devices[0].caps), JSON.stringify([
722
- {
1051
+ assert.equal(JSON.stringify(devices[0].caps), JSON.stringify([{
723
1052
  type: "video/x-raw",
724
1053
  width: 2304,
725
1054
  height: 1536,
@@ -927,8 +1256,7 @@ Device found:
927
1256
  assert.equal(devices.length, 1);
928
1257
  assert.equal(devices[0].id, '/dev/video1');
929
1258
  assert.equal(devices[0].name, 'HD Pro Webcam C920');
930
- assert.equal(JSON.stringify(devices[0].caps), JSON.stringify([
931
- {
1259
+ assert.equal(JSON.stringify(devices[0].caps), JSON.stringify([{
932
1260
  type: "video/x-raw",
933
1261
  width: 2304,
934
1262
  height: 1536,
@@ -1089,36 +1417,414 @@ Device found:
1089
1417
  assert.equal(devices.length, 1);
1090
1418
  assert.equal(devices[0].id, '/dev/video0');
1091
1419
  assert.equal(devices[0].name, 'RZG2L_CRU');
1092
- assert.equal(JSON.stringify(devices[0].caps), JSON.stringify([
1093
- {
1094
- type: "video/x-raw",
1095
- width: 640,
1096
- height: 480,
1097
- framerate: 0
1098
- }
1099
- ]));
1420
+ assert.equal(JSON.stringify(devices[0].caps), JSON.stringify([{
1421
+ type: "video/x-raw",
1422
+ width: 640,
1423
+ height: 480,
1424
+ framerate: 0
1425
+ }]));
1100
1426
  });
1101
- });
1102
- });
1103
1427
 
1104
- async function testGetDevices(gstOutput: string, gstLaunchNvargusCameraSrcOutput: string | undefined) {
1105
- const spawnHelper: SpawnHelperType = async (command: string,
1106
- args: string[],
1107
- opts: { ignoreErrors: boolean, cwd?: string } = { ignoreErrors: false }) => {
1428
+ // Tested locally (Jan)
1429
+ it("logitech c922 on rpi bullseye #2", async () => {
1430
+ const gstOutput = `Probing devices...
1108
1431
 
1109
- if (command === 'which') {
1110
- return '';
1111
- }
1112
- else if (command === 'gst-device-monitor-1.0') {
1113
- return gstOutput;
1114
- }
1115
- else if (command === 'gst-inspect-1.0') {
1116
- return 'nvarguscamerasrc'; // nvidia probing
1117
- }
1118
- else if (command === 'gst-launch-1.0' && args[0] === 'nvarguscamerasrc') {
1119
- return gstLaunchNvargusCameraSrcOutput || '';
1120
- }
1121
- else {
1432
+ [1698:57:08.508902920] [22184] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3156-f4070274
1433
+
1434
+ Device found:
1435
+
1436
+ name : /base/scb/pcie@7d500000/pci@1,0/usb@1,0-1.1:1.0-046d:085c
1437
+ class : Source/Video
1438
+ caps : image/jpeg, width=160, height=90
1439
+ image/jpeg, width=160, height=120
1440
+ image/jpeg, width=176, height=144
1441
+ image/jpeg, width=320, height=180
1442
+ image/jpeg, width=320, height=240
1443
+ image/jpeg, width=352, height=288
1444
+ image/jpeg, width=432, height=240
1445
+ image/jpeg, width=640, height=360
1446
+ image/jpeg, width=640, height=480
1447
+ image/jpeg, width=800, height=448
1448
+ image/jpeg, width=864, height=480
1449
+ image/jpeg, width=800, height=600
1450
+ image/jpeg, width=1024, height=576
1451
+ image/jpeg, width=960, height=720
1452
+ image/jpeg, width=1280, height=720
1453
+ image/jpeg, width=1600, height=896
1454
+ image/jpeg, width=1920, height=1080
1455
+ video/x-raw, format=YUY2, width=160, height=90
1456
+ video/x-raw, format=YUY2, width=160, height=120
1457
+ video/x-raw, format=YUY2, width=176, height=144
1458
+ video/x-raw, format=YUY2, width=320, height=180
1459
+ video/x-raw, format=YUY2, width=320, height=240
1460
+ video/x-raw, format=YUY2, width=352, height=288
1461
+ video/x-raw, format=YUY2, width=432, height=240
1462
+ video/x-raw, format=YUY2, width=640, height=360
1463
+ video/x-raw, format=YUY2, width=640, height=480
1464
+ video/x-raw, format=YUY2, width=800, height=448
1465
+ video/x-raw, format=YUY2, width=864, height=480
1466
+ video/x-raw, format=YUY2, width=800, height=600
1467
+ video/x-raw, format=YUY2, width=1024, height=576
1468
+ video/x-raw, format=YUY2, width=960, height=720
1469
+ video/x-raw, format=YUY2, width=1280, height=720
1470
+ video/x-raw, format=YUY2, width=1600, height=896
1471
+ video/x-raw, format=YUY2, width=1920, height=1080
1472
+ video/x-raw, format=YUY2, width=2304, height=1296
1473
+ video/x-raw, format=YUY2, width=2304, height=1536
1474
+ gst-launch-1.0 libcamerasrc camera-name="/base/scb/pcie\@7d500000/pci\@1\,0/usb\@1\,0-1.1:1.0-046d:085c" ! ...
1475
+
1476
+
1477
+ Device found:
1478
+
1479
+ name : Monitor of Built-in Audio Analog Stereo
1480
+ class : Audio/Source
1481
+ caps : audio/x-raw, format={ (string)S16LE, (string)S16BE, (string)F32LE, (string)F32BE, (string)S32LE, (string)S32BE, (string)S24LE, (string)S24BE, (string)S24_32LE, (string)S24_32BE, (string)U8 }, layout=interleaved, rate=[ 1, 384000 ], channels=[ 1, 32 ]
1482
+ audio/x-alaw, rate=[ 1, 384000 ], channels=[ 1, 32 ]
1483
+ audio/x-mulaw, rate=[ 1, 384000 ], channels=[ 1, 32 ]
1484
+ properties:
1485
+ device.description = "Monitor\ of\ Built-in\ Audio\ Analog\ Stereo"
1486
+ device.class = monitor
1487
+ alsa.card = 0
1488
+ alsa.card_name = "bcm2835\ Headphones"
1489
+ alsa.long_card_name = "bcm2835\ Headphones"
1490
+ alsa.driver_name = snd_bcm2835
1491
+ device.bus_path = platform-bcm2835_audio
1492
+ sysfs.path = /devices/platform/soc/fe00b840.mailbox/bcm2835_audio/sound/card0
1493
+ device.form_factor = internal
1494
+ device.string = 0
1495
+ module-udev-detect.discovered = 1
1496
+ device.icon_name = audio-card
1497
+ is-default = false
1498
+ gst-launch-1.0 pulsesrc device=alsa_output.platform-bcm2835_audio.analog-stereo.monitor ! ...
1499
+
1500
+
1501
+ Device found:
1502
+
1503
+ name : C922 Pro Stream Webcam Analog Stereo
1504
+ class : Audio/Source
1505
+ caps : audio/x-raw, format={ (string)S16LE, (string)S16BE, (string)F32LE, (string)F32BE, (string)S32LE, (string)S32BE, (string)S24LE, (string)S24BE, (string)S24_32LE, (string)S24_32BE, (string)U8 }, layout=interleaved, rate=[ 1, 384000 ], channels=[ 1, 32 ]
1506
+ audio/x-alaw, rate=[ 1, 384000 ], channels=[ 1, 32 ]
1507
+ audio/x-mulaw, rate=[ 1, 384000 ], channels=[ 1, 32 ]
1508
+ properties:
1509
+ alsa.resolution_bits = 16
1510
+ device.api = alsa
1511
+ device.class = sound
1512
+ alsa.class = generic
1513
+ alsa.subclass = generic-mix
1514
+ alsa.name = "USB\ Audio"
1515
+ alsa.id = "USB\ Audio"
1516
+ alsa.subdevice = 0
1517
+ alsa.subdevice_name = "subdevice\ \#0"
1518
+ alsa.device = 0
1519
+ alsa.card = 3
1520
+ alsa.card_name = "C922\ Pro\ Stream\ Webcam"
1521
+ alsa.long_card_name = "C922\ Pro\ Stream\ Webcam\ at\ usb-0000:01:00.0-1.1\,\ high\ speed"
1522
+ alsa.driver_name = snd_usb_audio
1523
+ device.bus_path = platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.1:1.2
1524
+ sysfs.path = /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.1/1-1.1:1.2/sound/card3
1525
+ udev.id = usb-046d_C922_Pro_Stream_Webcam_C72F6EDF-02
1526
+ device.bus = usb
1527
+ device.vendor.id = 046d
1528
+ device.vendor.name = "Logitech\,\ Inc."
1529
+ device.product.id = 085c
1530
+ device.product.name = "C922\ Pro\ Stream\ Webcam"
1531
+ device.serial = 046d_C922_Pro_Stream_Webcam_C72F6EDF
1532
+ device.form_factor = webcam
1533
+ device.string = front:3
1534
+ device.buffering.buffer_size = 7672
1535
+ device.buffering.fragment_size = 1916
1536
+ device.access_mode = mmap
1537
+ device.profile.name = analog-stereo
1538
+ device.profile.description = "Analog\ Stereo"
1539
+ device.description = "C922\ Pro\ Stream\ Webcam\ Analog\ Stereo"
1540
+ module-udev-detect.discovered = 1
1541
+ device.icon_name = camera-web-usb
1542
+ is-default = true
1543
+ gst-launch-1.0 pulsesrc device=alsa_input.usb-046d_C922_Pro_Stream_Webcam_C72F6EDF-02.analog-stereo ! ...
1544
+
1545
+
1546
+ Device found:
1547
+
1548
+ name : Built-in Audio Analog Stereo
1549
+ class : Audio/Sink
1550
+ caps : audio/x-raw, format={ (string)S16LE, (string)S16BE, (string)F32LE, (string)F32BE, (string)S32LE, (string)S32BE, (string)S24LE, (string)S24BE, (string)S24_32LE, (string)S24_32BE, (string)U8 }, layout=interleaved, rate=[ 1, 384000 ], channels=[ 1, 32 ]
1551
+ audio/x-alaw, rate=[ 1, 384000 ], channels=[ 1, 32 ]
1552
+ audio/x-mulaw, rate=[ 1, 384000 ], channels=[ 1, 32 ]
1553
+ properties:
1554
+ alsa.resolution_bits = 16
1555
+ device.api = alsa
1556
+ device.class = sound
1557
+ alsa.class = generic
1558
+ alsa.subclass = generic-mix
1559
+ alsa.name = "bcm2835\ Headphones"
1560
+ alsa.id = "bcm2835\ Headphones"
1561
+ alsa.subdevice = 0
1562
+ alsa.subdevice_name = "subdevice\ \#0"
1563
+ alsa.device = 0
1564
+ alsa.card = 0
1565
+ alsa.card_name = "bcm2835\ Headphones"
1566
+ alsa.long_card_name = "bcm2835\ Headphones"
1567
+ alsa.driver_name = snd_bcm2835
1568
+ device.bus_path = platform-bcm2835_audio
1569
+ sysfs.path = /devices/platform/soc/fe00b840.mailbox/bcm2835_audio/sound/card0
1570
+ device.form_factor = internal
1571
+ device.string = hw:0
1572
+ device.buffering.buffer_size = 10576
1573
+ device.buffering.fragment_size = 2640
1574
+ device.access_mode = mmap
1575
+ device.profile.name = analog-stereo
1576
+ device.profile.description = "Analog\ Stereo"
1577
+ device.description = "Built-in\ Audio\ Analog\ Stereo"
1578
+ module-udev-detect.discovered = 1
1579
+ device.icon_name = audio-card
1580
+ is-default = true
1581
+ gst-launch-1.0 ... ! pulsesink device=alsa_output.platform-bcm2835_audio.analog-stereo
1582
+
1583
+
1584
+ Device found:
1585
+
1586
+ name : UvcH264 C922 Pro Stream Webcam
1587
+ class : Video/CameraSource
1588
+ caps : video/x-raw, format=YUY2, width=2304, height=1536, pixel-aspect-ratio=1/1, framerate=2/1
1589
+ video/x-raw, format=YUY2, width=2304, height=1296, pixel-aspect-ratio=1/1, framerate=2/1
1590
+ video/x-raw, format=YUY2, width=1920, height=1080, pixel-aspect-ratio=1/1, framerate=5/1
1591
+ video/x-raw, format=YUY2, width=1600, height=896, pixel-aspect-ratio=1/1, framerate={ (fraction)15/2, (fraction)5/1 }
1592
+ video/x-raw, format=YUY2, width=1280, height=720, pixel-aspect-ratio=1/1, framerate={ (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1593
+ video/x-raw, format=YUY2, width=960, height=720, pixel-aspect-ratio=1/1, framerate={ (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1594
+ video/x-raw, format=YUY2, width=1024, height=576, pixel-aspect-ratio=1/1, framerate={ (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1595
+ video/x-raw, format=YUY2, width=800, height=600, pixel-aspect-ratio=1/1, framerate={ (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1596
+ video/x-raw, format=YUY2, width=864, height=480, pixel-aspect-ratio=1/1, framerate={ (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1597
+ video/x-raw, format=YUY2, width=800, height=448, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1598
+ video/x-raw, format=YUY2, width=640, height=480, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1599
+ video/x-raw, format=YUY2, width=640, height=360, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1600
+ video/x-raw, format=YUY2, width=432, height=240, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1601
+ video/x-raw, format=YUY2, width=352, height=288, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1602
+ video/x-raw, format=YUY2, width=320, height=240, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1603
+ video/x-raw, format=YUY2, width=320, height=180, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1604
+ video/x-raw, format=YUY2, width=176, height=144, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1605
+ video/x-raw, format=YUY2, width=160, height=120, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1606
+ video/x-raw, format=YUY2, width=160, height=90, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1607
+ image/jpeg, width=1920, height=1080, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1608
+ image/jpeg, width=1600, height=896, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1609
+ image/jpeg, width=1280, height=720, pixel-aspect-ratio=1/1, framerate={ (fraction)60/1, (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1610
+ image/jpeg, width=960, height=720, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1611
+ image/jpeg, width=1024, height=576, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1612
+ image/jpeg, width=800, height=600, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1613
+ image/jpeg, width=864, height=480, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1614
+ image/jpeg, width=800, height=448, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1615
+ image/jpeg, width=640, height=480, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1616
+ image/jpeg, width=640, height=360, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1617
+ image/jpeg, width=432, height=240, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1618
+ image/jpeg, width=352, height=288, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1619
+ image/jpeg, width=320, height=240, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1620
+ image/jpeg, width=320, height=180, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1621
+ image/jpeg, width=176, height=144, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1622
+ image/jpeg, width=160, height=120, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1623
+ image/jpeg, width=160, height=90, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1624
+ properties:
1625
+ device.path = /dev/video0
1626
+ udev-probed = false
1627
+ device.api = uvch264
1628
+ v4l2.device.driver = uvcvideo
1629
+ v4l2.device.card = "C922\ Pro\ Stream\ Webcam"
1630
+ v4l2.device.bus_info = usb-0000:01:00.0-1.1
1631
+ v4l2.device.version = 330303 (0x00050a3f)
1632
+ v4l2.device.capabilities = 2225078273 (0x84a00001)
1633
+ v4l2.device.device_caps = 69206017 (0x04200001)
1634
+ device.is-camerasrc = true
1635
+ gst-launch-1.0 uvch264src.vfsrc name=camerasrc ! ... camerasrc.vidsrc ! [video/x-h264] ...
1636
+
1637
+
1638
+ Device found:
1639
+
1640
+ name : UvcH264 C922 Pro Stream Webcam
1641
+ class : Video/CameraSource
1642
+ caps : video/x-raw, format=YUY2, width=2304, height=1536, pixel-aspect-ratio=1/1, framerate=2/1
1643
+ video/x-raw, format=YUY2, width=2304, height=1296, pixel-aspect-ratio=1/1, framerate=2/1
1644
+ video/x-raw, format=YUY2, width=1920, height=1080, pixel-aspect-ratio=1/1, framerate=5/1
1645
+ video/x-raw, format=YUY2, width=1600, height=896, pixel-aspect-ratio=1/1, framerate={ (fraction)15/2, (fraction)5/1 }
1646
+ video/x-raw, format=YUY2, width=1280, height=720, pixel-aspect-ratio=1/1, framerate={ (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1647
+ video/x-raw, format=YUY2, width=960, height=720, pixel-aspect-ratio=1/1, framerate={ (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1648
+ video/x-raw, format=YUY2, width=1024, height=576, pixel-aspect-ratio=1/1, framerate={ (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1649
+ video/x-raw, format=YUY2, width=800, height=600, pixel-aspect-ratio=1/1, framerate={ (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1650
+ video/x-raw, format=YUY2, width=864, height=480, pixel-aspect-ratio=1/1, framerate={ (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1651
+ video/x-raw, format=YUY2, width=800, height=448, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1652
+ video/x-raw, format=YUY2, width=640, height=480, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1653
+ video/x-raw, format=YUY2, width=640, height=360, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1654
+ video/x-raw, format=YUY2, width=432, height=240, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1655
+ video/x-raw, format=YUY2, width=352, height=288, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1656
+ video/x-raw, format=YUY2, width=320, height=240, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1657
+ video/x-raw, format=YUY2, width=320, height=180, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1658
+ video/x-raw, format=YUY2, width=176, height=144, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1659
+ video/x-raw, format=YUY2, width=160, height=120, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1660
+ video/x-raw, format=YUY2, width=160, height=90, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1661
+ image/jpeg, width=1920, height=1080, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1662
+ image/jpeg, width=1600, height=896, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1663
+ image/jpeg, width=1280, height=720, pixel-aspect-ratio=1/1, framerate={ (fraction)60/1, (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1664
+ image/jpeg, width=960, height=720, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1665
+ image/jpeg, width=1024, height=576, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1666
+ image/jpeg, width=800, height=600, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1667
+ image/jpeg, width=864, height=480, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1668
+ image/jpeg, width=800, height=448, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1669
+ image/jpeg, width=640, height=480, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1670
+ image/jpeg, width=640, height=360, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1671
+ image/jpeg, width=432, height=240, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1672
+ image/jpeg, width=352, height=288, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1673
+ image/jpeg, width=320, height=240, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1674
+ image/jpeg, width=320, height=180, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1675
+ image/jpeg, width=176, height=144, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1676
+ image/jpeg, width=160, height=120, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1677
+ image/jpeg, width=160, height=90, pixel-aspect-ratio=1/1, framerate={ (fraction)30/1, (fraction)24/1, (fraction)20/1, (fraction)15/1, (fraction)10/1, (fraction)15/2, (fraction)5/1 }
1678
+ properties:
1679
+ udev-probed = true
1680
+ device.bus_path = platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.1:1.0
1681
+ sysfs.path = /sys/devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.1/1-1.1:1.0/video4linux/video0
1682
+ device.bus = usb
1683
+ device.subsystem = video4linux
1684
+ device.vendor.id = 046d
1685
+ device.vendor.name = 046d
1686
+ device.product.id = 085c
1687
+ device.product.name = "C922\ Pro\ Stream\ Webcam"
1688
+ device.serial = 046d_C922_Pro_Stream_Webcam_C72F6EDF
1689
+ device.capabilities = :capture:
1690
+ device.api = uvch264
1691
+ device.path = /dev/video0
1692
+ v4l2.device.driver = uvcvideo
1693
+ v4l2.device.card = "C922\ Pro\ Stream\ Webcam"
1694
+ v4l2.device.bus_info = usb-0000:01:00.0-1.1
1695
+ v4l2.device.version = 330303 (0x00050a3f)
1696
+ v4l2.device.capabilities = 2225078273 (0x84a00001)
1697
+ v4l2.device.device_caps = 69206017 (0x04200001)
1698
+ device.is-camerasrc = true
1699
+ gst-launch-1.0 uvch264src.vfsrc name=camerasrc ! ... camerasrc.vidsrc ! [video/x-h264] ...
1700
+ `;
1701
+
1702
+ const devices = await testGetDevices(gstOutput, undefined);
1703
+
1704
+ assert.equal(devices.length, 1);
1705
+ assert.equal(devices[0].id, '/dev/video0');
1706
+ assert.equal(devices[0].name, 'UvcH264 C922 Pro Stream Webcam (/dev/video0)');
1707
+ assert.equal(JSON.stringify(devices[0].caps), JSON.stringify([
1708
+ {
1709
+ type: "video/x-raw",
1710
+ width: 2304,
1711
+ height: 1536,
1712
+ framerate: 2
1713
+ }, {
1714
+ type: "video/x-raw",
1715
+ width: 2304,
1716
+ height: 1296,
1717
+ framerate: 2
1718
+ }, {
1719
+ type: "video/x-raw",
1720
+ width: 1920,
1721
+ height: 1080,
1722
+ framerate: 5
1723
+ }, {
1724
+ type: "video/x-raw",
1725
+ width: 1600,
1726
+ height: 896,
1727
+ framerate: 15
1728
+ }, {
1729
+ type: "video/x-raw",
1730
+ width: 1280,
1731
+ height: 720,
1732
+ framerate: 10
1733
+ }, {
1734
+ type: "video/x-raw",
1735
+ width: 960,
1736
+ height: 720,
1737
+ framerate: 15
1738
+ }, {
1739
+ type: "video/x-raw",
1740
+ width: 1024,
1741
+ height: 576,
1742
+ framerate: 15
1743
+ }, {
1744
+ type: "video/x-raw",
1745
+ width: 800,
1746
+ height: 600,
1747
+ framerate: 24
1748
+ }, {
1749
+ type: "video/x-raw",
1750
+ width: 864,
1751
+ height: 480,
1752
+ framerate: 24
1753
+ }, {
1754
+ type: "video/x-raw",
1755
+ width: 800,
1756
+ height: 448,
1757
+ framerate: 30
1758
+ }, {
1759
+ type: "video/x-raw",
1760
+ width: 640,
1761
+ height: 480,
1762
+ framerate: 30
1763
+ }, {
1764
+ type: "video/x-raw",
1765
+ width: 640,
1766
+ height: 360,
1767
+ framerate: 30
1768
+ }, {
1769
+ type: "video/x-raw",
1770
+ width: 432,
1771
+ height: 240,
1772
+ framerate: 30
1773
+ }, {
1774
+ type: "video/x-raw",
1775
+ width: 352,
1776
+ height: 288,
1777
+ framerate: 30
1778
+ }, {
1779
+ type: "video/x-raw",
1780
+ width: 320,
1781
+ height: 240,
1782
+ framerate: 30
1783
+ }, {
1784
+ type: "video/x-raw",
1785
+ width: 320,
1786
+ height: 180,
1787
+ framerate: 30
1788
+ }, {
1789
+ type: "video/x-raw",
1790
+ width: 176,
1791
+ height: 144,
1792
+ framerate: 30
1793
+ }, {
1794
+ type: "video/x-raw",
1795
+ width: 160,
1796
+ height: 120,
1797
+ framerate: 30
1798
+ }, {
1799
+ type: "video/x-raw",
1800
+ width: 160,
1801
+ height: 90,
1802
+ framerate: 30
1803
+ }
1804
+ ]));
1805
+ });
1806
+ });
1807
+ });
1808
+
1809
+ async function testGetDevices(gstOutput: string, gstLaunchNvargusCameraSrcOutput: string | undefined) {
1810
+ const spawnHelper: SpawnHelperType = async (command: string,
1811
+ args: string[],
1812
+ opts: {
1813
+ ignoreErrors: boolean,
1814
+ cwd ? : string
1815
+ } = {
1816
+ ignoreErrors: false
1817
+ }) => {
1818
+
1819
+ if (command === 'which') {
1820
+ return '';
1821
+ } else if (command === 'gst-device-monitor-1.0') {
1822
+ return gstOutput;
1823
+ } else if (command === 'gst-inspect-1.0') {
1824
+ return 'nvarguscamerasrc'; // nvidia probing
1825
+ } else if (command === 'gst-launch-1.0' && args[0] === 'nvarguscamerasrc') {
1826
+ return gstLaunchNvargusCameraSrcOutput || '';
1827
+ } else {
1122
1828
  throw new Error('spawnHelper failed on ' + command + ' ' + args.join(' '));
1123
1829
  }
1124
1830
  };
@@ -1127,4 +1833,4 @@ async function testGetDevices(gstOutput: string, gstLaunchNvargusCameraSrcOutput
1127
1833
  await gstreamer.init();
1128
1834
  const devices = await gstreamer.getAllDevices();
1129
1835
  return devices;
1130
- }
1836
+ }