Ubuntu 13.10でGnome 3.1を使用してAvconvを使用して、Minecraftスクリーンキャストを記録しています。ただし、ラップトップスピーカーではなく、マイクからのみ音声を取得できます。ラップトップとマイクの両方を録音するにはどうすればよいですか?マイク付きのUSBヘッドセットを使用しています。
@Sneetsherが要求する情報:
実際のコマンド:
avconv -f Pulse -i default -b 64k -f x11grab -r 25 -s 1280x800 -i :0.0 -vcodec libx264 -preset ultrafast -threads 4 -y myscreencast2.mp4
PulseAudio情報:
$ pactl list short
0 module-device-restore
1 module-stream-restore
2 module-card-restore
3 module-augment-properties
4 module-switch-on-port-available
5 module-alsa-card device_id="0" name="pci-0000_00_1b.0" card_name="alsa_card.pci-0000_00_1b.0" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1"
6 module-alsa-card device_id="1" name="usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device" card_name="alsa_card.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1"
7 module-udev-detect
8 module-bluetooth-policy
9 module-bluetooth-discover
10 module-native-protocol-unix
11 module-default-device-restore
12 module-rescue-streams
13 module-always-sink
14 module-intended-roles
15 module-suspend-on-idle
16 module-systemd-login
17 module-position-event-sounds
18 module-filter-heuristics
19 module-filter-apply
20 module-x11-publish display=:0
21 module-x11-bell display=:0 sample=bell.ogg
22 module-x11-cork-request display=:0
23 module-x11-xsmp display=:0 session_manager=local/MELVIN-124833:@/tmp/.ICE-unix/2013,unix/MELVIN-124833:/tmp/.ICE-unix/2013
0 alsa_output.pci-0000_00_1b.0.analog-stereo module-alsa-card.c s16le 2ch 44100Hz IDLE
1 alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device.iec958-stereo module-alsa-card.c s16le 2ch 44100Hz IDLE
0 alsa_output.pci-0000_00_1b.0.analog-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz RUNNING
1 alsa_input.pci-0000_00_1b.0.analog-stereo module-alsa-card.c s16le 2ch 44100Hz RUNNING
2 alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device.iec958-stereo.monitor module-alsa-card.c s16le 2ch 44100Hz RUNNING
3 alsa_input.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device.analog-mono module-alsa-card.c s16le 1ch 44100Hz RUNNING
15 0 28 protocol-native.c float32le 1ch 25Hz
16 1 28 protocol-native.c float32le 1ch 25Hz
17 2 28 protocol-native.c float32le 1ch 25Hz
18 3 28 protocol-native.c float32le 1ch 25Hz
0 module-systemd-login.c (null)
5 module-x11-xsmp.c (null)
6 protocol-native.c gnome-settings-daemon
7 protocol-native.c gnome-Shell
8 protocol-native.c gnome-Shell
9 protocol-native.c chrome
28 protocol-native.c pavucontrol
36 protocol-native.c pactl
0 screen-capture s16le 2ch 96000Hz 0.872
1 bell-window-system s16le 2ch 44100Hz 0.749
0 alsa_card.pci-0000_00_1b.0 module-alsa-card.c
1 alsa_card.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device module-alsa-card.c
$ pactl stats
Currently in use: 12 blocks containing 548.2 KiB bytes total.
Allocated during whole lifetime: 7254422 blocks containing 2.9 GiB bytes total.
Sample cache size: 456.2 KiB
Server String: unix:/run/user/1000/Pulse/native
Library Protocol Version: 28
Server Protocol Version: 28
Is Local: yes
Client Index: 37
Tile Size: 65496
User Name: guilmon
Host Name: MELVIN-124833
Server Name: pulseaudio
Server Version: 4.0
Default Sample Specification: s16le 2ch 44100Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device.iec958-stereo
Default Source: alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device.iec958-stereo.monitor
Cookie: 3f2a:1764
更新されたスクリーンショット:
$ pactl list sources
Source #0
State: SUSPENDED
Name: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
Description: Monitor of Built-in Audio Analogue Stereo
Driver: module-alsa-card.c
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 5
Mute: no
Volume: 0: 20% 1: 20%
0: -42.50 dB 1: -42.50 dB
balance 0.00
Base Volume: 100%
0.00 dB
Monitor of Sink: alsa_output.pci-0000_00_1b.0.analog-stereo
Latency: 0 usec, configured 0 usec
Flags: DECIBEL_VOLUME LATENCY
Properties:
device.description = "Monitor of Built-in Audio Analogue Stereo"
device.class = "monitor"
alsa.card = "0"
alsa.card_name = "HDA Intel"
alsa.long_card_name = "HDA Intel at 0xe4644000 irq 48"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1b.0"
sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "284b"
device.product.name = "82801H (ICH8 Family) HD Audio Controller"
device.form_factor = "internal"
device.string = "0"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
Formats:
pcm
Source #1
State: SUSPENDED
Name: alsa_input.pci-0000_00_1b.0.analog-stereo
Description: Built-in Audio Analogue Stereo
Driver: module-alsa-card.c
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 5
Mute: no
Volume: 0: 84% 1: 84%
0: -4.50 dB 1: -4.50 dB
balance 0.00
Base Volume: 13%
-52.50 dB
Monitor of Sink: n/a
Latency: 0 usec, configured 0 usec
Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
Properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "AD198x Analog"
alsa.id = "AD198x Analog"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "0"
alsa.card_name = "HDA Intel"
alsa.long_card_name = "HDA Intel at 0xe4644000 irq 48"
alsa.driver_name = "snd_hda_intel"
device.bus_path = "pci-0000:00:1b.0"
sysfs.path = "/devices/pci0000:00/0000:00:1b.0/sound/card0"
device.bus = "pci"
device.vendor.id = "8086"
device.vendor.name = "Intel Corporation"
device.product.id = "284b"
device.product.name = "82801H (ICH8 Family) HD Audio Controller"
device.form_factor = "internal"
device.string = "front:0"
device.buffering.buffer_size = "65536"
device.buffering.fragment_size = "32768"
device.access_mode = "mmap+timer"
device.profile.name = "analog-stereo"
device.profile.description = "Analogue Stereo"
device.description = "Built-in Audio Analogue Stereo"
alsa.mixer_name = "Analog Devices AD1981"
alsa.components = "HDA:11d41981,103c30be,00100200 HDA:14f12c06,103c1379,00100000"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-pci"
Ports:
analog-input-microphone-internal: Internal Microphone (priority: 8900)
analog-input-microphone-dock: Dock Microphone (priority: 7800)
analog-input-microphone: Microphone (priority: 8700)
Active Port: analog-input-microphone
Formats:
pcm
Source #5
State: SUSPENDED
Name: alsa_input.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device.analog-mono
Description: USB PnP Sound Device Analogue Mono
Driver: module-alsa-card.c
Sample Specification: s16le 1ch 48000Hz
Channel Map: mono
Owner Module: 26
Mute: no
Volume: 0: 85%
0: -4.10 dB
balance 0.00
Base Volume: 40%
-23.81 dB
Monitor of Sink: n/a
Latency: 0 usec, configured 0 usec
Flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY
Properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "USB Audio"
alsa.id = "USB Audio"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "1"
alsa.card_name = "USB PnP Sound Device"
alsa.long_card_name = "C-Media Electronics Inc. USB PnP Sound Device at usb-0000:00:1d.2-2, full speed"
alsa.driver_name = "snd_usb_audio"
device.bus_path = "pci-0000:00:1d.2-usb-0:2:1.0"
sysfs.path = "/devices/pci0000:00/0000:00:1d.2/usb7/7-2/7-2:1.0/sound/card1"
udev.id = "usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device"
device.bus = "usb"
device.vendor.id = "0d8c"
device.vendor.name = "C-Media Electronics, Inc."
device.product.id = "0139"
device.product.name = "USB PnP Sound Device"
device.serial = "C-Media_Electronics_Inc._USB_PnP_Sound_Device"
device.string = "hw:1"
device.buffering.buffer_size = "176400"
device.buffering.fragment_size = "88200"
device.access_mode = "mmap+timer"
device.profile.name = "analog-mono"
device.profile.description = "Analogue Mono"
device.description = "USB PnP Sound Device Analogue Mono"
alsa.mixer_name = "USB Mixer"
alsa.components = "USB0d8c:0139"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-usb"
Ports:
analog-input-microphone: Microphone (priority: 8700)
Active Port: analog-input-microphone
Formats:
pcm
Source #8
State: SUSPENDED
Name: alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device.analog-stereo.monitor
Description: Monitor of USB PnP Sound Device Analogue Stereo
Driver: module-alsa-card.c
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 26
Mute: no
Volume: 0: 100% 1: 100%
0: 0.00 dB 1: 0.00 dB
balance 0.00
Base Volume: 100%
0.00 dB
Monitor of Sink: alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device.analog-stereo
Latency: 0 usec, configured 0 usec
Flags: DECIBEL_VOLUME LATENCY
Properties:
device.description = "Monitor of USB PnP Sound Device Analogue Stereo"
device.class = "monitor"
alsa.card = "1"
alsa.card_name = "USB PnP Sound Device"
alsa.long_card_name = "C-Media Electronics Inc. USB PnP Sound Device at usb-0000:00:1d.2-2, full speed"
alsa.driver_name = "snd_usb_audio"
device.bus_path = "pci-0000:00:1d.2-usb-0:2:1.0"
sysfs.path = "/devices/pci0000:00/0000:00:1d.2/usb7/7-2/7-2:1.0/sound/card1"
udev.id = "usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device"
device.bus = "usb"
device.vendor.id = "0d8c"
device.vendor.name = "C-Media Electronics, Inc."
device.product.id = "0139"
device.product.name = "USB PnP Sound Device"
device.serial = "C-Media_Electronics_Inc._USB_PnP_Sound_Device"
device.string = "1"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card-usb"
Formats:
pcm
Pulse Audio Controlをインストールする
Sudo apt-get install pavucontrol
再生レコードのみ(マイクなし)
開く→入力デバイス→表示:すべての入力デバイス→右の緑色のボタンを使用して、「モニター:アナログオーディオ」を選択します
さまざまなチャンネル名がありますが、プレーヤーを実行して、どのプレーヤーに信号があるかを確認できます。
Gnomeボリュームコントロールを開くと、マイクに戻されます。遅いリリースの13.04、13.10、14.04に気づきました。 Gnomeボリュームコントロールを使用して元に戻すことはできません。 (録音時に使用しないでください)
マイクと再生の両方が混在しています:pactl
CLIを使用できます。例:
シンクの名前を確認してください
$ pactl list short sinks
0 alsa_output.pci-0000_01_00.1.hdmi-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
1 alsa_output.pci-0000_00_1b.0.analog-stereo module-alsa-card.c s16le 2ch 44100Hz SUSPENDED
ループバックマイクソースからアナログシンク
$ pactl load-module module-loopback latency_msec=1 sink=alsa_output.pci-0000_00_1b.0.analog-stereo
30
上記の同じ手順を使用して、正しい入力デバイスを選択します。
それを閉じるには:
$ pactl unload-module 30
または名前を使用して:
$ pactl unload-module module-loopback
モジュールIDを確認するには:
$ pactl list short modules
場合、入力デバイスで再生アナログモニターが見つかりません
[構成]タブを確認します。全二重(入力/出力)
それ以外の場合、仮想出力デバイスを作成してからループバックすることができます。
pactl load-module module-null-sink sink_name=Virtual1
pactl load-module module-loopback latency_msec=1 sink=Virtual1
次に、Pulse Audio Control、上記と同じ手順を使用して、正しい入力デバイスVirtual1を選択します。
出力デバイスの場合:
すべての混合システム出力が必要な場合は、Output Devicesタブを使用します。
または、一部のアプリケーション出力のみが必要な場合は、Playbackタブを使用します(VLC音楽の再生など)。この場合、何かを録音し、他の何かを聞くことができます。
参考として、 PulseAudio仮想オーディオストリームを使用してSkypeで音楽を再生するにはどうすればよいですか?
機能しなかった場合(例としてあなたの場合)
「アナログステレオ出力」シンクの正確な名前を確認してください
pactl list sinks
マイクを「アナログステレオ出力」にループバックします
pactl load-module module-loopback latency_msec=1 sink=alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device.analog-stereo
「アナログステレオ出力モニター」ソースの正確な名前を確認してください
pactl list sources
次に、「Analog Stereo Output Monitor」のデバイス名を指定して直接録音します。あなたの場合の例:
avconv -f Pulse -i "alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device.analog-stereo.monitor" -b 64k -f x11grab -r 25 -s 1280x800 -i :0.0 -vcodec libx264 -preset ultrafast -threads 4 -y myscreencast2.mp4
-i:0.は、Pulseからマイクを「盗み」、録音中にマイクを使用できなくなります(スカイプでの会話のように)。
Loobackインターフェイスは、再生されたサウンドと録音されたサウンドの間に遅延をもたらします。
これは私のために働いた:
ffmpeg -f Pulse -i 0 -f Pulse -i 1 -filter_complex amerge out.wav
&1は、Pulseオーディオソースが
pactl list sinks