View previous topic :: View next topic |
Author |
Message |
Blind_Sniper Guru
Joined: 20 Apr 2018 Posts: 340
|
Posted: Sat Aug 26, 2023 4:49 pm Post subject: Screen capture |
|
|
Trying to capture screen:
Code: | ffmpeg -video_size 768x920 -framerate 25 -f x11grab -i :0.0+250,120 -f alsa -ac 2 -i hw:0 output.mp4
|
Video is OK, but sound is missing. What's wrong with this command? _________________ GNU is Not Usable |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3150
|
|
Back to top |
|
|
Blind_Sniper Guru
Joined: 20 Apr 2018 Posts: 340
|
Posted: Sat Aug 26, 2023 5:40 pm Post subject: |
|
|
@szatox thanks for your input.
I tried to modprobe snd-aloop, but failed: Module snd-aloop not found in directory /lib/modules/6.1.12-gentoo. Kernel menuconfig seems lack of this module.
Is it separate package for snd-aloop? _________________ GNU is Not Usable |
|
Back to top |
|
|
Blind_Sniper Guru
Joined: 20 Apr 2018 Posts: 340
|
Posted: Sat Aug 26, 2023 7:03 pm Post subject: |
|
|
Enabled CONFIG_SND_ALOOP, rebuilt kernel & modules, loaded module and corrected .asoundrc to match above link. Now no sound at all. When removing .asoundrc sound works again, but still no sound capture _________________ GNU is Not Usable |
|
Back to top |
|
|
szatox Advocate
Joined: 27 Aug 2013 Posts: 3150
|
Posted: Sat Aug 26, 2023 7:37 pm Post subject: |
|
|
When you had "no sound at all", did you try recording in that state or just noticed there is no audio playback and gave up?
That link has 2 examples of recording the output from application. First is loopback only, the other is loopback + playback. More complex, and more work to set up, but won't be interfering with you actually using your pc. |
|
Back to top |
|
|
Blind_Sniper Guru
Joined: 20 Apr 2018 Posts: 340
|
Posted: Sat Aug 26, 2023 7:55 pm Post subject: |
|
|
I need loopback+playback.
And I don't know what to put into asoundrc instead of <Your Output Device Name>
Code: | pcm.output {
type hw
card <Your Output Device Name>
} |
_________________ GNU is Not Usable |
|
Back to top |
|
|
Blind_Sniper Guru
Joined: 20 Apr 2018 Posts: 340
|
Posted: Sat Aug 26, 2023 8:58 pm Post subject: |
|
|
Right now I have this in asoundrc:
Code: | pcm.multi {
type route;
slave.pcm {
type multi;
slaves.a.pcm "output";
slaves.b.pcm "loopin";
slaves.a.channels 2;
slaves.b.channels 2;
bindings.0.slave a;
bindings.0.channel 0;
bindings.1.slave a;
bindings.1.channel 1;
bindings.2.slave b;
bindings.2.channel 0;
bindings.3.slave b;
bindings.3.channel 1;
}
ttable.0.0 1;
ttable.1.1 1;
ttable.0.2 1;
ttable.1.3 1;
}
pcm.!hw:0 {
type plug
slave.pcm "multi"
}
pcm.output {
type hw
card 0
}
pcm.loopin {
type plug
slave.pcm "hw:Loopback,0,0"
}
pcm.loopout {
type plug
slave.pcm "hw:Loopback,1,0"
} |
And capturing with this command:
Code: | ffmpeg -video_size 768x920 -framerate 25 -f x11grab -i :0.0+250,120 -f alsa -ac 2 -i loopout output.mp4
|
Sound works, but still no sound in output.mp4. _________________ GNU is Not Usable |
|
Back to top |
|
|
shadowless Tux's lil' helper
Joined: 27 Nov 2022 Posts: 102
|
Posted: Sun Aug 27, 2023 3:39 am Post subject: |
|
|
I don't need to specify a loopback plug in my asoundrc to record audio out. It varies per hardware setup, but usually the default alsa setup works out of the box.
Check the recording side of your sound device with alsamixer to make sure its not muted. |
|
Back to top |
|
|
Blind_Sniper Guru
Joined: 20 Apr 2018 Posts: 340
|
Posted: Sun Aug 27, 2023 2:50 pm Post subject: |
|
|
alsamixer shows that all capture devices unmuted (except microphone). Loopback device is enabled. Sources for capture input set to Line. _________________ GNU is Not Usable |
|
Back to top |
|
|
|