Gentoo Archives: gentoo-user

From: Walter Dnes <waltdnes@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT] ffmpeg video+audio capture question
Date: Wed, 18 Sep 2019 18:03:54
Message-Id: 20190918180302.GA5689@waltdnes.org
In Reply to: Re: [gentoo-user] [OT] ffmpeg video+audio capture question by Mick
1 On Wed, Sep 18, 2019 at 11:16:41AM +0100, Mick wrote
2 > On Wednesday, 18 September 2019 10:10:16 BST Walter Dnes wrote:
3 > >
4 > > ffmpeg -f alsa -ac 2 -i hw:0 -video_size 1920x1080 -framerate 25 -f x11grab
5 > > -i :0.0 output.mp4
6 >
7 > The above should work, but only if your active audio card has Card
8 > ID 0. If your PC uses HDMI as the first card you'll need to adjust
9 > /etc/asound.conf accordingly to switch to your analogue audio device,
10 > or perhaps try hw:1 in the above incantation instead.
11
12 "aplay -l" outputs
13
14 **** List of PLAYBACK Hardware Devices ****
15 card 0: PCH [HDA Intel PCH], device 0: CX20641 Analog [CX20641 Analog]
16 Subdevices: 0/1
17 Subdevice #0: subdevice #0
18 card 0: PCH [HDA Intel PCH], device 3: Generic Digital [Generic Digital]
19 Subdevices: 1/1
20 Subdevice #0: subdevice #0
21
22 If I try "hw:1" it dies immediately (No such file or directory)
23
24 No /etc/asound.conf or $HOME/.asoundrc on my system. But there is a
25 large (9596 bytes) /usr/share/alsa/alsa.conf
26
27 > Also, check your Mic is not muted with alsamixer, or your desktop GUI
28 > equivalent.
29
30 Enabled them, but no difference.
31
32 > Did you try USE="alsa, -speex"?
33
34 "emerge -pv mlayer" shows that speex is disabled.
35
36 The console I launch ffmpeg from shows a lot of stuff like...
37
38 [alsa @ 0x559c480c94c0] ALSA buffer xrun.
39 frame= 2337 fps= 25 q=28.0 size= 11008kB time=00:01:33.05 bitrate= 969.1kbits/frame= 2350 fps= 25 q=28.0 size= 11008kB time=00:01:33.05 bitrate= 969.1kbits/frame= 2362 fps= 25 q=28.0 size= 11008kB time=00:01:33.05 bitrate= 969.1kbits/frame= 2375 fps= 25 q=28.0 size= 11008kB time=00:01:33.05 bitrate= 969.1kbits/[alsa @ 0x559c480c94c0] ALSA buffer xrun.
40 frame= 2387 fps= 25 q=28.0 size= 11264kB time=00:01:35.21 bitrate= 969.2kbits/frame= 2400 fps= 25 q=28.0 size= 11264kB time=00:01:35.21 bitrate= 969.2kbits/frame= 2412 fps= 25 q=28.0 size= 11264kB time=00:01:35.21 bitrate= 969.2kbits/frame= 2425 fps= 25 q=28.0 size= 11264kB time=00:01:35.21 bitrate= 969.2kbits/[alsa @ 0x559c480c94c0] ALSA buffer xrun.
41
42 When I playback with mplayer and exit, there's a bunch of diagnostics.
43 Towards the end it says...
44
45 ==========================================================================
46 Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
47 AUDIO: 48000 Hz, 2 ch, floatle, 0.1 kbit/0.00% (ratio: 17->384000)
48 Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
49 ==========================================================================
50 AO: [alsa] 48000Hz 2ch floatle (4 bytes per sample)
51 Starting playback...
52 Could not find matching colorspace - retrying with -vf scale...
53 Opening video filter: [scale]
54 Movie-Aspect is undefined - no prescaling applied.
55 [swscaler @ 0x7f28e3f20100]bicubic scaler, from yuv444p to yuv420p using MMXEXT
56 VO: [xv] 1920x1080 => 1920x1080 Planar YV12
57 A: 38.9 V: 35.9 A-V: 3.003 ct: 3.588 0/ 0 17% 12% 0.0% 0 0
58 Timing looks severely broken, resetting
59 A: 38.9 V: 39.6 A-V: -0.717 ct: 3.805 0/ 0 17% 12% 0.0% 0 0
60
61 The message about timing may be a clue.
62
63 --
64 Walter Dnes <waltdnes@××××××××.org>
65 I don't run "desktop environments"; I run useful applications

Replies

Subject Author
Re: [gentoo-user] [OT] ffmpeg video+audio capture question Mick <michaelkintzios@×××××.com>