Problèmes et questions sur les environnements graphiques et les applications.
Répondre

Enregistrer écran et son avec ffmpeg

#1Messageil y a 2 ans

Bonjour,

J'essaye d'enregistrer une partie de mon écran avec le son. Pour cela j'utilise ffmpeg avec la commande suivante :

ffmpeg -y -f alsa -i hw:0 -f x11grab -framerate 30 -video_size 300x168 -i :0.0+2,28 -c:v libx264 -pix_fmt yuv420p -qp 0 -preset ultrafast screen.avi
Mais le son est tout faible, c'est comme si j'enregistrais le micro de pon PC plutot que directement la carte son...

Une idée ?

Si je fais :

pactl list sources                                            at  15:41:37
Source #0
	State: IDLE
	Name: alsa_output.pci-0000_00_1b.0.analog-stereo.monitor
	Description: Monitor of Audio interne Stéréo analogique
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 44100Hz
	Channel Map: front-left,front-right
	Owner Module: 7
	Mute: no
	Volume: front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB
	        balance 0.00
	Base Volume: 65536 / 100% / 0.00 dB
	Monitor of Sink: alsa_output.pci-0000_00_1b.0.analog-stereo
	Latency: 0 usec, configured 2000000 usec
	Flags: DECIBEL_VOLUME LATENCY 
	Properties:
		device.description = "Monitor of Audio interne Stéréo analogique"
		device.class = "monitor"
		alsa.card = "0"
		alsa.card_name = "HDA Intel MID"
		alsa.long_card_name = "HDA Intel MID at 0xdb100000 irq 27"
		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 = "3b56"
		device.product.name = "5 Series/3400 Series Chipset High Definition Audio"
		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: Audio interne Stéréo analogique
	Driver: module-alsa-card.c
	Sample Specification: s16le 2ch 48000Hz
	Channel Map: front-left,front-right
	Owner Module: 7
	Mute: yes
	Volume: front-left: 54394 /  83% / -4.86 dB,   front-right: 54394 /  83% / -4.86 dB
	        balance 0.00
	Base Volume: 8739 /  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 = "92HD75B3X5 Analog"
		alsa.id = "92HD75B3X5 Analog"
		alsa.subdevice = "0"
		alsa.subdevice_name = "subdevice #0"
		alsa.device = "0"
		alsa.card = "0"
		alsa.card_name = "HDA Intel MID"
		alsa.long_card_name = "HDA Intel MID at 0xdb100000 irq 27"
		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 = "3b56"
		device.product.name = "5 Series/3400 Series Chipset High Definition Audio"
		device.form_factor = "internal"
		device.string = "front:0"
		device.buffering.buffer_size = "352800"
		device.buffering.fragment_size = "176400"
		device.access_mode = "mmap+timer"
		device.profile.name = "analog-stereo"
		device.profile.description = "Stéréo analogique"
		device.description = "Audio interne Stéréo analogique"
		module-udev-detect.discovered = "1"
		device.icon_name = "audio-card-pci"
	Ports:
		analog-input-internal-mic: Internal Microphone (type: Mic, priority: 8900, availability unknown)
		analog-input-mic: Microphone (type: Mic, priority: 8700, not available)
	Active Port: analog-input-internal-mic
	Formats:
		pcm
Merci.

Enregistrer écran et son avec ffmpeg

#2Messageil y a 2 ans

Résolu, après avoir trouvé la source '0', voici l bonne commande :

ffmpeg -y -f pulse -ac 2 -i 0 -f x11grab -framerate 30 -video_size 300x168 -i :0.0+2,28 -c:v libx264 -pix_fmt yuv420p -qp 0 -preset ultrafast screen.avi
Répondre