나는 내 것을 얻으려고 노력 중이야소니 A5100웹캠으로 작동리눅스, 구체적으로페도라 325.11.22-100.fc32.x86_64
커널 에 . 이제 업그레이드할 때가 된 것 같은데, 제가 잘못하고 있는 부분은 없는지 먼저 여기부터 확인해 봐야겠다는 생각이 들었습니다.
다음과 같은인터넷 가이드v4l2loopback
모듈 ffmpeg
등을 포함하여 몇 가지를 설치했습니다 . 다음 스크립트를 사용하십시오.
#! /bin/bash
log() {
echo "## $1" >&2
}
confirm() {
read -r -p "## ${1}? [y/N] " response
[ ${response:-N} = y ] && return 0 || return 1
}
log "Loading kernel module"
sudo modprobe v4l2loopback devices=1 exclusive_caps=1
log "Listing devices"
v4l2-ctl --list-devices
log "Finding device"
device=$(lsusb | grep -i elgato)
if [ -z "$device" ]; then
log "No device found"
exit 1
else
log "Found USB device '$device'"
fi
if confirm "Reset USB"; then
bus=$(echo "$device" | awk '{ print $2 }')
dev=$(echo "$device" | awk '{ print $4 }' | sed 's/://g')
log "Resetting USB bus=$bus dev=$dev"
sudo ${HOME}/projects/usbreset/usbreset "/dev/bus/usb/${bus}/${dev}"
else
log "Not resetting USB"
fi
if confirm "Flush buffers"; then
log "Flushing buffers"
sudo modprobe -v -r uvcvideo && sudo modprobe -v uvcvideo
else
log "Not resetting USB"
fi
video=($(ls /dev/video*))
select choice in "${video[@]}"; do
log "Selected '$choice'"
log "Listing video formats"
v4l2-ctl -d $choice --get-fmt-video
log "Start playback"
ffplay -pixel_format yuyv422 $choice
break
done
( usbreset
스크립트는 다음에서 제공됩니다.여기) 단일 프레임을 표시하는 일관된 방법이 있지만 카메라가 비디오를 스트리밍하도록 할 수 없습니다. USB 설정, 케이블, 캡처 카드, 카메라 설정 등이 모두 잘 작동합니다.윈도우, 그러나 다시 문제가 발생했습니다.리눅스.
위 스크립트의 출력은 cam
다음과 같습니다.
./cam
## Loading kernel module
## Listing devices
OBS Virtual Camera (platform:v4l2loopback-000):
/dev/video0
Cam Link 4K: Cam Link 4K (usb-0000:00:14.0-4.3):
/dev/video3
/dev/video4
Integrated Camera: Integrated C (usb-0000:00:14.0-8):
/dev/video1
/dev/video2
## Finding device
## Found USB device 'Bus 002 Device 007: ID 0fd9:0066 Elgato Systems GmbH USB 10/100/1000 LAN'
## Reset USB? [y/N] y
## Resetting USB bus=002 dev=007
Resetting USB device /dev/bus/usb/002/007
Reset successful
## Flush buffers? [y/N] y
## Flushing buffers
rmmod uvcvideo
rmmod videobuf2_v4l2
rmmod videobuf2_common
rmmod videobuf2_vmalloc
rmmod videobuf2_memops
insmod /lib/modules/5.11.22-100.fc32.x86_64/kernel/drivers/media/common/videobuf2/videobuf2-common.ko.xz
insmod /lib/modules/5.11.22-100.fc32.x86_64/kernel/drivers/media/common/videobuf2/videobuf2-v4l2.ko.xz
insmod /lib/modules/5.11.22-100.fc32.x86_64/kernel/drivers/media/common/videobuf2/videobuf2-memops.ko.xz
insmod /lib/modules/5.11.22-100.fc32.x86_64/kernel/drivers/media/common/videobuf2/videobuf2-vmalloc.ko.xz
insmod /lib/modules/5.11.22-100.fc32.x86_64/kernel/drivers/media/usb/uvc/uvcvideo.ko.xz
1) /dev/video0
2) /dev/video1
3) /dev/video2
4) /dev/video3
5) /dev/video4
#? 4
## Selected '/dev/video3'
## Listing video formats
Format Video Capture:
Width/Height : 1920/1080
Pixel Format : 'YUYV' (YUYV 4:2:2)
Field : None
Bytes per Line : 3840
Size Image : 4147200
Colorspace : sRGB
Transfer Function : Rec. 709
YCbCr/HSV Encoding: Rec. 709
Quantization : Default (maps to Limited Range)
Flags :
## Start playback
ffplay version 4.2.4 Copyright (c) 2003-2020 the FFmpeg developers
built with gcc 10 (GCC)
configuration: --prefix=/usr --bindir=/usr/bin --datadir=/usr/share/ffmpeg --docdir=/usr/share/doc/ffmpeg --incdir=
mat-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-swi
fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection' --extra-ldflags='-Wl,-z,relro -Wl,--as-needed -
core-amrwb --enable-libvo-amrwbenc --enable-version3 --enable-bzlib --disable-crystalhd --enable-fontconfig --enable-
ray --enable-libcdio --enable-libdrm --enable-libjack --enable-libfreetype --enable-libfribidi --enable-libgsm --enab
nable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-libsrt --enable-libsoxr --enable-libspe
version3 --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-libxml2 --enable-libzimg --enabl
isable-static --enable-shared --enable-gpl --disable-debug --disable-stripping --shlibdir=/usr/lib64 --enable-libmfx
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, video4linux2,v4l2, from '/dev/video3':B sq= 0B f=0/0
Duration: N/A, start: 2085.401686, bitrate: 1988671 kb/s
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 1988671 kb/s, 59.94 fps, 59.94 tbr, 1000k t
X connection to :0 broken (explicit kill or server shutdown).=0/0
때로는 일반적으로 "성공적인" 단일 프레임을 얻은 후 다음과 같은 메시지가 표시됩니다.
[video4linux2,v4l2 @ 0x7fc034000c80] Dequeued v4l2 buffer contains corrupted data (0 bytes).
Input #0, video4linux2,v4l2, from '/dev/video3':
Duration: N/A, start: 300.727603, bitrate: 1988671 kb/s
Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1920x1080, 1988671 kb/s, 59.94 fps, 59.94 tbr, 1000k tbn, 1000k tbc
[video4linux2,v4l2 @ 0x7fc034000c80] Dequeued v4l2 buffer contains corrupted data (0 bytes).
Last message repeated 158 times
다음과 같은 경우에도 동일한 일이 발생합니다.OBS,급등하다, 등.
총 길이 DR: 모든 것~인 것 같다내 것을 사용하려고 할 때 작동합니다.소니 A5100웹캠으로엘가토 캠링크 4K(장치가 올바른 형식으로 표시되는 등) 그런데 한 프레임만 표시할 수 있습니다. 비디오 스트리밍이 정상적으로 시작됩니다윈도우현재 카메라 설정을 사용합니다.