网络摄像头可以以 root 身份工作,但不能以普通用户身份工作:我需要更改哪些权限?

网络摄像头可以以 root 身份工作,但不能以普通用户身份工作:我需要更改哪些权限?

当我cheese以 root 身份运行时,我可以正常看到来自网络摄像头的视频流。但是,当我以普通用户身份运行时,我收到“未找到设备”的提示。有问题的普通用户位于对相关设备文件具有读写权限的组 (video) 中/dev/video0。请问我如何以普通用户身份获得网络摄像头访问权限?

以 root 身份运行的输出cheese是:

(cheese:5512): GLib-GObject-CRITICAL **: 14:43:01.263:
g_value_dup_string: assertion 'G_VALUE_HOLDS_STRING (value)' failed
(cheese:5512): GLib-GObject-CRITICAL **: 14:43:03.915:
g_value_dup_string: assertion 'G_VALUE_HOLDS_STRING (value)' failed
root@verderer:~# cheese
(cheese:5786): GLib-GObject-CRITICAL **: 14:58:42.863:
g_value_dup_string: assertion 'G_VALUE_HOLDS_STRING (value)' failed
(cheese:5786): GLib-GObject-CRITICAL **: 14:58:45.498:
g_value_dup_string: assertion 'G_VALUE_HOLDS_STRING (value)' failed

cheese以普通用户身份运行的输出是:

(cheese:5650): Gdk-WARNING **: 14:47:18.091: Native Windows taller
than 65535 pixels are not supported
** Message: 14:47:18.151: cheese-application.vala:222: Error during camera setup: No device found
(cheese:5650): cheese-CRITICAL **: 14:47:18.185:
cheese_camera_device_get_name: assertion 'CHEESE_IS_CAMERA_DEVICE
(device)' failed
(cheese:5650): GLib-CRITICAL **: 14:47:18.185: g_variant_new_string:
assertion 'string != NULL' failed
(cheese:5650): GLib-CRITICAL **: 14:47:18.185: g_variant_ref_sink:
assertion 'value != NULL' failed
(cheese:5650): GLib-GIO-CRITICAL **: 14:47:18.185:
g_settings_schema_key_type_check: assertion 'value != NULL' failed
(cheese:5650): GLib-CRITICAL **: 14:47:18.185:
g_variant_get_type_string: assertion 'value != NULL' failed
(cheese:5650): GLib-GIO-CRITICAL **: 14:47:18.185:
> g_settings_set_value: key 'camera' in 'org.gnome.Cheese' expects type's', but a GVariant of type '(null)' was given
(cheese:5650): GLib-CRITICAL **: 14:47:18.185: g_variant_unref:
assertion 'value != NULL' failed
** (cheese:5650): CRITICAL **: 14:47:18.185: cheese_preferences_dialog_setup_resolutions_for_device: assertion
'device != NULL' failed

答案1

查看相机的所有权和权限:ls -l /dev/video*。请注意,它允许rw组成员访问video

使用以下命令将您自己添加到video组中:

sudo adduser $USER video 

login然后完全注销并登录。组成员身份通过(和newgrp命令)应用。

相关内容