我安装了 ubuntu 24.04,在启动器中有相机应用程序的图标,但是当我打开它时,我收到消息说没有检测到相机,我下载了奶酪应用程序,它检测到了相机,所以我决定删除相机应用程序,当我搜索时软件商店中的相机应用程序要求我安装它,因此相机应用程序未安装,但启动器中有一个图标,我不知道如何删除该图标,最后我安装了相机应用程序,并出现了另一个相机图标,这次安装后它有效,但仍然不知道如何摆脱启动器中多余的相机图标。
$ ls -ltrh /dev/video*
crw-rw----+ 1 root video 81, 1 Mai 4 00:17 /dev/video1
crw-rw----+ 1 root video 81, 0 Mai 4 00:17 /dev/video0
这是一台笔记本电脑,所以我猜一个是内置摄像头,一个是屏幕。但是我怎样才能检查哪个?有没有办法获得有关其中一个的更多信息?
我有一个内置摄像头,我想更改 Ubuntu 的摄像头访问权限!在 Windows 中,我可以简单地转到隐私 > 相机并关闭访问!但是如何在 Ubuntu 中做到这一点?
编辑:我找到了一种暂时禁用相机的方法
要暂时禁用相机 - sudo modprobe -r uvcvideo
要启用它 -sudo modprobe uvcvideo
我买了一个新的 USB 网络摄像头,插上它。
ls -l /dev/video*
crw-rw----+ 1 root video 81, 0 Nov 21 10:57 /dev/video0
crw-rw----+ 1 root video 81, 1 Nov 21 10:57 /dev/video1
为什么只有一个 USB 摄像头显示两个 Video4Linux 设备?
按照说明安装v4l2loopback
内核模块和gphoto2
.
我可以使用 控制相机和拍照Entangle
,还可以在其中查看实时预览视频Entangle
,但我无法使用 ffmpeg 流式传输视频以在其他应用程序中使用它。
$ gphoto2 --abilities
Abilities for camera : Sony DSC-RX100M4
Serial port support : no
USB support : yes
Capture choices :
: Image
: Preview
: Trigger Capture
Configuration support : yes
Delete selected files on camera : yes
Delete all files on camera : no
File preview (thumbnail) support : yes
File upload support : yes
杀死所有现有实例
$ sudo killall gvfs-gphoto2-volume-monitor
gvfs-gphoto2-volume-monitor: no process found
有 3 个 /dev/video*
$ ll /dev/video*
crw-rw----+ 1 root video 81, 0 Nov 7 08:46 /dev/video0
crw-rw----+ 1 root video 81, 1 Nov 7 08:46 /dev/video1
crw-rw----+ 1 root video 81, 2 Nov 7 09:35 /dev/video2
运行将视频传送到 /dev/video* 的命令对其中任何一个都不起作用:
$ gphoto2 --stdout --capture-movie | gst-launch-1.0 fdsrc ! decodebin3 name=dec ! queue ! videoconvert ! v4l2sink device=/dev/video2
Capturing preview frames as movie to 'stdout'. Press Ctrl-C to abort.
Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0: Device '/dev/video2' is not a output device.
Additional debug info:
v4l2_calls.c(636): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Sink:v4l2sink0:
Capabilities: 0x85208000
Setting pipeline to NULL ...
Freeing pipeline ...
*** Error ***
Sorry, your Sony camera does not seem to return a JPEG image in LiveView mode
ERROR: Movie capture error... Exiting.
Movie capture finished (0 frames)
如官方说明中所述,我尝试了在相机上的 AUTO 和 MOVIE 模式之间切换的不同方法,但没有运气......
知道我错过了什么吗?
是否Sorry, your Sony camera does not seem to return a JPEG image in LiveView mode
意味着它不适用于我的相机?( Sony DSC-RX100M4
)
另一个命令(ffmpeg
):
$ gphoto2 --stdout --capture-movie | ffmpeg -i - -vcodec rawvideo -pix_fmt yuv420p -threads 0 -f v4l2 /dev/video1
Capturing preview frames as movie to 'stdout'. Press Ctrl-C to abort.
ffmpeg version n4.1.4 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.4.0-1ubuntu1~18.04.1)
configuration: --prefix= --prefix=/usr --disable-debug --disable-doc --disable-static --enable-avisynth --enable-cuda --enable-cuvid --enable-libdrm --enable-ffplay --enable-gnutls --enable-gpl --enable-libass --enable-libfdk-aac --enable-libfontconfig --enable-libfreetype --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopus --enable-libpulse --enable-sdl2 --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libv4l2 --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-nonfree --enable-nvenc --enable-omx --enable-openal --enable-opencl --enable-runtime-cpudetect --enable-shared --enable-vaapi --enable-vdpau --enable-version3 --enable-xlib
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
[mjpeg @ 0x55bb2836b0c0] Format mjpeg detected only with low score of 25, misdetection possible!
Input #0, mjpeg, from 'pipe:':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 1024x680, 25 tbr, 1200k tbn, 25 tbc
Stream mapping:
Stream #0:0 -> #0:0 (mjpeg (native) -> rawvideo (native))
[swscaler @ 0x55bb283bef00] deprecated pixel format used, make sure you did set range correctly
[video4linux2,v4l2 @ 0x55bb28370dc0] Unable to open V4L2 device '/dev/video1'
Could not write header for output file #0 (incorrect codec parameters ?): Operation not permitted
Error initializing output stream 0:0 --
Conversion failed!
ubuntu 的新内核版本(4.4.0-186-generic 和 4.4.0-187-generic)无法识别我的 USB 摄像头(无论是笔记本电脑的原始版本还是其他 USB 网络摄像头)。如果我从以前的内核版本(4.4.0-185-generic)开始,两者都可以正常工作。
这是“lsusb”的结果:...
Bus 001 Device 003: ID 04f2:b537 Chicony Electronics Co., Ltd
Bus 001 Device 009: ID 046d:0892 Logitech, Inc. OrbiCam
...
但它们不显示为 /dev/video0 和 /dev/video1,并且无法被奶酪、缩放、相遇等检测到。
这些内核版本是否需要任何额外的驱动程序,或者它真的坏了?
谢谢
除了文件传输,我无法连接我的索尼 A7RII 相机;lsusb
显示与相机无关的输出。
安装了最新gphoto2
版本并gphoto2 --list-cameras| grep -i "A7R II"
声称支持相机(libgphoto2 网页粗体显示“图像捕捉、触发捕捉、实时取景、配置”功能)。
远程文档警告使用libgphoto2 2.5.13 或更新版本(我已经检查过)。
以下是is的env LANG=C gphoto2 --debug --debug-logfile=my-logfile.txt --config
输出
*** Error ***
Could not detect any camera
*** Error (-105: 'Unknown model') ***
0.000002 main (2): ALWAYS INCLUDE THE FOLLOWING LINES WHEN SENDING DEBUG MESSAGES TO THE MAILING LIST:
0.000033 main (2): gphoto2 2.5.23
0.000058 main (2): gphoto2 has been compiled with the following options:
0.000060 main (2): + gcc (C compiler used)
0.000061 main (2): + popt (mandatory, for handling command-line parameters)
0.000063 main (2): + exif (for displaying EXIF information)
0.000065 main (2): + cdk (for accessing configuration options)
0.000066 main (2): + aa (for displaying live previews)
0.000068 main (2): + jpeg (for displaying live previews in JPEG format)
0.000089 main (2): + readline (for easy navigation in the shell)
0.000093 main (2): libgphoto2 2.5.24
0.000112 main (2): libgphoto2 has been compiled with the following options:
0.000115 main (2): + standard camlib set SKIPPING SOME (ax203 canon digigr8 dimagev directory jl2005a jl2005c kodak_dc240 mars pentax ptp2 ricoh_g3 sierra sonix sq905 st2205 topfield tp6801 SKIPPING lumix)
0.000116 main (2): + gcc (C compiler used)
0.000118 main (2): + ltdl (for portable loading of camlibs)
0.000120 main (2): + EXIF (for special handling of EXIF files)
0.000122 main (2): libgphoto2_port 0.12.0
0.000124 main (2): libgphoto2_port has been compiled with the following options:
0.000126 main (2): + iolibs: disk ptpip serial usb1 usbdiskdirect usbscsi
0.000128 main (2): + gcc (C compiler used)
0.000129 main (2): + ltdl (for portable loading of iolibs)
0.000131 main (2): + EXIF (for vusb)
0.000133 main (2): + USB (libusb1, for USB cameras)
0.000134 main (2): + serial (for serial cameras)
0.000136 main (2): + no resmgr (serial port access and locking)
0.000137 main (2): + no ttylock (serial port locking)
0.000139 main (2): + no lockdev (serial port locking)
0.000141 main (2): CAMLIBS env var not set, using compile-time default instead
0.000143 main (2): IOLIBS env var not set, using compile-time default instead
0.000144 main (2): invoked with following arguments:
0.000146 main (2): --debug
0.000148 main (2): --debug-logfile=my-logfile.txt
0.000149 main (2): --config
0.000171 load_settings (2): Creating gphoto config directory ('/home/lrkwz/.gphoto')
0.000204 load_settings (2): Loading settings from file '/home/lrkwz/.gphoto/settings'.
0.000258 main (2): The user has not specified both a model and a port. Try to figure them out.
(...)
在我的
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.
Handle 0x000E, DMI type 1, 27 bytes
System Information
Manufacturer: LENOVO
Product Name: 2350B58
Version: ThinkPad T430
Serial Number: PBVVBLH
UUID: cdcb8a01-5190-11cb-9490-98976e1f3194
Wake-up Type: Power Switch
SKU Number: LENOVO_MT_2350
Family: ThinkPad T430
是一个内置摄像头,但我在 /dev 中有两个设备节点。
ls -ltrh /dev/video*
crw-rw----+ 1 root video 81, 1 Apr 25 08:23 /dev/video1
crw-rw----+ 1 root video 81, 0 Apr 25 08:23 /dev/video0
质量低。
lsusb | grep camera
Bus 001 Device 006: ID 04f2:b2db Chicony Electronics Co., Ltd Thinkpad T430 camera
运行内核
uname -r 5.3.0-46-generic
我的系统是从 ubuntu 19.04 升级而来的。