Аналогичные вопросы были заданы и получили ответы на вопрос о захвате видео с веб-камеры. Существует ряд принятых ответов. Тем не менее, они либо из древних версий Ubuntu, которые больше не поддерживаются или связаны только с видео, а не как с видео, так и с аудио в качестве предмета этого вопроса. Кроме того, предметом этого вопроса является использование текущей версии LTS Ubuntu.
В настоящее время официальная документация Ubuntu Wiki также имеет устаревшие резолюции, которые не работают.
Там это некоторые графические приложения, которые могут захватывать как аудио, так и видео с веб-камеры. Но этого не будет достаточно для того, чтобы иметь возможность легко включать видео в сценарии.
Многие другие ссылки на эту тему включают в себя варианты поддержки Ubuntu Official Documentation wor Webcam:
Строкой с предыдущим приглашением $ является команда. Следующие строки являются ответом на ошибку.
$ ffmpeg -f oss -i /dev/dsp -f video4linux2 -s 320x240 -i /dev/video0 out.mpg
[oss @ 0x15f38a0] /dev/dsp: No such file or directory
/dev/dsp: Input/output error
и
$ avconv -f oss -i /dev/dsp -f video4linux2 -s 320x240 -i /dev/video0 out.mpg
[oss @ 0xd9b8a0] /dev/dsp: No such file or directory
/dev/dsp: Input/output error
В то время как две приведенные выше команды не работают, эта команда будет захватывать 10 секунд видео с веб-камеры:
$ timeout 10 ffmpeg -f video4linux2 -s 320x240 -i /dev/video0 out.mpg
Как вы можете видеть, удаление проблемного аудиовхода позволяет удалить ошибку. Таким образом, не хватает поддерживаемого аудиовхода, который бы соответствовал этой опции. Я пытаюсь получить информацию о том, как использовать официальную встроенную поддержку звука перед установкой и попыткой настройки других звуковых пакетов.
Я вижу ссылки на установку других пакетов для поддержки звука, но я хотел бы сначала получить информацию о том, как использовать то, что уже установлено на Ubuntu 16.04LTS, по умолчанию, если оно работоспособно.
Выход из dmesg -w после веб-камеры USB подключен:
[41763.153707] CPU7: Core temperature/speed normal
[41763.153708] CPU3: Core temperature/speed normal
[41845.576323] retire_capture_urb: 66 callbacks suppressed
[41845.699994] usb 2-1.4: USB disconnect, device number 14
[41872.523599] usb 2-1.4: new high-speed USB device number 15 using ehci-pci
[41872.882616] usb 2-1.4: New USB device found, idVendor=046d, idProduct=0826
[41872.882620] usb 2-1.4: New USB device strings: Mfr=0, Product=2, SerialNumber=1
[41872.882622] usb 2-1.4: Product: HD Webcam C525
[41872.882624] usb 2-1.4: SerialNumber: 94D25250
[41873.142026] usb 2-1.4: current rate 5666600 is different from the runtime rate 16000
[41873.145382] usb 2-1.4: current rate 8859453 is different from the runtime rate 24000
[41873.149264] usb 2-1.4: current rate 12572339 is different from the runtime rate 32000
[41873.152635] usb 2-1.4: current rate 10782671 is different from the runtime rate 48000
[41873.165044] usb 2-1.4: set resolution quirk: cval->res = 384
[41873.165529] uvcvideo: Found UVC 1.00 device HD Webcam C525 (046d:0826)
[41873.178089] input: HD Webcam C525 as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.4/2-1.4:1.2/input/input33
[41873.222700] usb 2-1.4: current rate 5530139 is different from the runtime rate 48000
[41873.226055] usb 2-1.4: current rate 698870 is different from the runtime rate 48000
[41873.243770] usb 2-1.4: current rate 1805767 is different from the runtime rate 48000
[41873.246765] usb 2-1.4: current rate 1763607 is different from the runtime rate 48000
Источник: Open Sound System - Wikipedia
Найдите звуковое устройство, используя arecord -L. Затем используйте его в командной строке.
Это приведет к записи 30 секунд видео с моей веб-камеры:
$ ffmpeg -f alsa -i plughw:CARD=C525,DEV=0 -f video4linux2 -s 320x240 -i /dev/video0 -t 30 out.mpg
Вывод iscord в моей системе вводится ниже с помощью аудиоустройства, которое я выбрал для использование выделено жирным шрифтом. В этом случае это plughw: CARD = C525, DEV = 0.
default Playback/recording through the PulseAudio sound server null Discard all samples (playback) or generate zero samples (capture) pulse PulseAudio Sound Server sysdefault:CARD=MID HDA Intel MID, ALC889A Analog Default Audio Device front:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Front speakers surround21:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 4.0 Surround output to Front and Rear speakers surround41:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers dmix:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Direct sample mixing device dmix:CARD=MID,DEV=2 HDA Intel MID, ALC889A Alt Analog Direct sample mixing device dsnoop:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Direct sample snooping device dsnoop:CARD=MID,DEV=2 HDA Intel MID, ALC889A Alt Analog Direct sample snooping device hw:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Direct hardware device without any conversions hw:CARD=MID,DEV=2 HDA Intel MID, ALC889A Alt Analog Direct hardware device without any conversions plughw:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Hardware device with all software conversions plughw:CARD=MID,DEV=2 HDA Intel MID, ALC889A Alt Analog Hardware device with all software conversions sysdefault:CARD=HDMI USB Capture HDMI, USB Audio Default Audio Device front:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Front speakers surround21:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 4.0 Surround output to Front and Rear speakers surround41:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers iec958:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio IEC958 (S/PDIF) Digital Audio Output dmix:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Direct sample mixing device dsnoop:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Direct sample snooping device hw:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Direct hardware device without any conversions plughw:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Hardware device with all software conversions sysdefault:CARD=C525 HD Webcam C525, USB Audio Default Audio Device front:CARD=C525,DEV=0 HD Webcam C525, USB Audio Front speakers surround21:CARD=C525,DEV=0 HD Webcam C525, USB Audio 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=C525,DEV=0 HD Webcam C525, USB Audio 4.0 Surround output to Front and Rear speakers surround41:CARD=C525,DEV=0 HD Webcam C525, USB Audio 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=C525,DEV=0 HD Webcam C525, USB Audio 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=C525,DEV=0 HD Webcam C525, USB Audio 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=C525,DEV=0 HD Webcam C525, USB Audio 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers iec958:CARD=C525,DEV=0 HD Webcam C525, USB Audio IEC958 (S/PDIF) Digital Audio Output dmix:CARD=C525,DEV=0 HD Webcam C525, USB Audio Direct sample mixing device dsnoop:CARD=C525,DEV=0 HD Webcam C525, USB Audio Direct sample snooping device hw:CARD=C525,DEV=0 HD Webcam C525, USB Audio Direct hardware device without any conversions plughw:CARD=C525,DEV=0 HD Webcam C525, USB Audio Hardware device with all software conversionsМногие из многих устройств могут быть устранены на основе аудио, которое вы пытаетесь захватить, например, объемного звука и мой случай других устройств захвата HDMI.
Источник: Open Sound System - Wikipedia
Найдите звуковое устройство, используя arecord -L. Затем используйте его в командной строке.
Это приведет к записи 30 секунд видео с моей веб-камеры:
$ ffmpeg -f alsa -i plughw:CARD=C525,DEV=0 -f video4linux2 -s 320x240 -i /dev/video0 -t 30 out.mpg
Вывод iscord в моей системе вводится ниже с помощью аудиоустройства, которое я выбрал для использование выделено жирным шрифтом. В этом случае это plughw: CARD = C525, DEV = 0.
default Playback/recording through the PulseAudio sound server null Discard all samples (playback) or generate zero samples (capture) pulse PulseAudio Sound Server sysdefault:CARD=MID HDA Intel MID, ALC889A Analog Default Audio Device front:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Front speakers surround21:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 4.0 Surround output to Front and Rear speakers surround41:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers dmix:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Direct sample mixing device dmix:CARD=MID,DEV=2 HDA Intel MID, ALC889A Alt Analog Direct sample mixing device dsnoop:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Direct sample snooping device dsnoop:CARD=MID,DEV=2 HDA Intel MID, ALC889A Alt Analog Direct sample snooping device hw:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Direct hardware device without any conversions hw:CARD=MID,DEV=2 HDA Intel MID, ALC889A Alt Analog Direct hardware device without any conversions plughw:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Hardware device with all software conversions plughw:CARD=MID,DEV=2 HDA Intel MID, ALC889A Alt Analog Hardware device with all software conversions sysdefault:CARD=HDMI USB Capture HDMI, USB Audio Default Audio Device front:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Front speakers surround21:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 4.0 Surround output to Front and Rear speakers surround41:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers iec958:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio IEC958 (S/PDIF) Digital Audio Output dmix:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Direct sample mixing device dsnoop:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Direct sample snooping device hw:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Direct hardware device without any conversions plughw:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Hardware device with all software conversions sysdefault:CARD=C525 HD Webcam C525, USB Audio Default Audio Device front:CARD=C525,DEV=0 HD Webcam C525, USB Audio Front speakers surround21:CARD=C525,DEV=0 HD Webcam C525, USB Audio 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=C525,DEV=0 HD Webcam C525, USB Audio 4.0 Surround output to Front and Rear speakers surround41:CARD=C525,DEV=0 HD Webcam C525, USB Audio 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=C525,DEV=0 HD Webcam C525, USB Audio 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=C525,DEV=0 HD Webcam C525, USB Audio 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=C525,DEV=0 HD Webcam C525, USB Audio 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers iec958:CARD=C525,DEV=0 HD Webcam C525, USB Audio IEC958 (S/PDIF) Digital Audio Output dmix:CARD=C525,DEV=0 HD Webcam C525, USB Audio Direct sample mixing device dsnoop:CARD=C525,DEV=0 HD Webcam C525, USB Audio Direct sample snooping device hw:CARD=C525,DEV=0 HD Webcam C525, USB Audio Direct hardware device without any conversions plughw:CARD=C525,DEV=0 HD Webcam C525, USB Audio Hardware device with all software conversionsМногие из многих устройств могут быть устранены на основе аудио, которое вы пытаетесь захватить, например, объемного звука и мой случай других устройств захвата HDMI.
Источник: Open Sound System - Wikipedia
Найдите звуковое устройство, используя arecord -L. Затем используйте его в командной строке.
Это приведет к записи 30 секунд видео с моей веб-камеры:
$ ffmpeg -f alsa -i plughw:CARD=C525,DEV=0 -f video4linux2 -s 320x240 -i /dev/video0 -t 30 out.mpg
Вывод iscord в моей системе вводится ниже с помощью аудиоустройства, которое я выбрал для использование выделено жирным шрифтом. В этом случае это plughw: CARD = C525, DEV = 0.
default Playback/recording through the PulseAudio sound server null Discard all samples (playback) or generate zero samples (capture) pulse PulseAudio Sound Server sysdefault:CARD=MID HDA Intel MID, ALC889A Analog Default Audio Device front:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Front speakers surround21:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 4.0 Surround output to Front and Rear speakers surround41:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers dmix:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Direct sample mixing device dmix:CARD=MID,DEV=2 HDA Intel MID, ALC889A Alt Analog Direct sample mixing device dsnoop:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Direct sample snooping device dsnoop:CARD=MID,DEV=2 HDA Intel MID, ALC889A Alt Analog Direct sample snooping device hw:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Direct hardware device without any conversions hw:CARD=MID,DEV=2 HDA Intel MID, ALC889A Alt Analog Direct hardware device without any conversions plughw:CARD=MID,DEV=0 HDA Intel MID, ALC889A Analog Hardware device with all software conversions plughw:CARD=MID,DEV=2 HDA Intel MID, ALC889A Alt Analog Hardware device with all software conversions sysdefault:CARD=HDMI USB Capture HDMI, USB Audio Default Audio Device front:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Front speakers surround21:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 4.0 Surround output to Front and Rear speakers surround41:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers iec958:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio IEC958 (S/PDIF) Digital Audio Output dmix:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Direct sample mixing device dsnoop:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Direct sample snooping device hw:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Direct hardware device without any conversions plughw:CARD=HDMI,DEV=0 USB Capture HDMI, USB Audio Hardware device with all software conversions sysdefault:CARD=C525 HD Webcam C525, USB Audio Default Audio Device front:CARD=C525,DEV=0 HD Webcam C525, USB Audio Front speakers surround21:CARD=C525,DEV=0 HD Webcam C525, USB Audio 2.1 Surround output to Front and Subwoofer speakers surround40:CARD=C525,DEV=0 HD Webcam C525, USB Audio 4.0 Surround output to Front and Rear speakers surround41:CARD=C525,DEV=0 HD Webcam C525, USB Audio 4.1 Surround output to Front, Rear and Subwoofer speakers surround50:CARD=C525,DEV=0 HD Webcam C525, USB Audio 5.0 Surround output to Front, Center and Rear speakers surround51:CARD=C525,DEV=0 HD Webcam C525, USB Audio 5.1 Surround output to Front, Center, Rear and Subwoofer speakers surround71:CARD=C525,DEV=0 HD Webcam C525, USB Audio 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers iec958:CARD=C525,DEV=0 HD Webcam C525, USB Audio IEC958 (S/PDIF) Digital Audio Output dmix:CARD=C525,DEV=0 HD Webcam C525, USB Audio Direct sample mixing device dsnoop:CARD=C525,DEV=0 HD Webcam C525, USB Audio Direct sample snooping device hw:CARD=C525,DEV=0 HD Webcam C525, USB Audio Direct hardware device without any conversions plughw:CARD=C525,DEV=0 HD Webcam C525, USB Audio Hardware device with all software conversionsМногие из многих устройств могут быть устранены на основе аудио, которое вы пытаетесь захватить, например, объемного звука и мой случай других устройств захвата HDMI.