On Wednesday, 18 September 2019 19:03:02 BST Walter Dnes wrote: > On Wed, Sep 18, 2019 at 11:16:41AM +0100, Mick wrote > > > On Wednesday, 18 September 2019 10:10:16 BST Walter Dnes wrote: > > > ffmpeg -f alsa -ac 2 -i hw:0 -video_size 1920x1080 -framerate 25 -f > > > x11grab > > > -i :0.0 output.mp4 > > > > The above should work, but only if your active audio card has Card > > ID 0. If your PC uses HDMI as the first card you'll need to adjust > > /etc/asound.conf accordingly to switch to your analogue audio device, > > or perhaps try hw:1 in the above incantation instead. > > "aplay -l" outputs > > **** List of PLAYBACK Hardware Devices **** > card 0: PCH [HDA Intel PCH], device 0: CX20641 Analog [CX20641 Analog] > Subdevices: 0/1 > Subdevice #0: subdevice #0 > card 0: PCH [HDA Intel PCH], device 3: Generic Digital [Generic Digital] > Subdevices: 1/1 > Subdevice #0: subdevice #0 > > If I try "hw:1" it dies immediately (No such file or directory)
Yes, you only have one card 0. The first device (default) is the analogue. What does 'arecord -l' show? > No /etc/asound.conf or $HOME/.asoundrc on my system. But there is a > large (9596 bytes) /usr/share/alsa/alsa.conf You would need to create a asound.conf card to switch from the HDMI to analogue as the default card, if your hardware was like mine - but it is not. Let's try something else, specifying a sub-device. What happens with: -i hw:0,1 or -i hw:0,0,1 Adjust the above according to what arecord shows. > The console I launch ffmpeg from shows a lot of stuff like... > > [alsa @ 0x559c480c94c0] ALSA buffer xrun. > 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. 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. > > When I playback with mplayer and exit, there's a bunch of diagnostics. > Towards the end it says... > > ========================================================================== > Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders > AUDIO: 48000 Hz, 2 ch, floatle, 0.1 kbit/0.00% (ratio: 17->384000) > Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio)) > ========================================================================== > AO: [alsa] 48000Hz 2ch floatle (4 bytes per sample) > Starting playback... > Could not find matching colorspace - retrying with -vf scale... > Opening video filter: [scale] > Movie-Aspect is undefined - no prescaling applied. > [swscaler @ 0x7f28e3f20100]bicubic scaler, from yuv444p to yuv420p using > MMXEXT VO: [xv] 1920x1080 => 1920x1080 Planar YV12 > A: 38.9 V: 35.9 A-V: 3.003 ct: 3.588 0/ 0 17% 12% 0.0% 0 0 > Timing looks severely broken, resetting > A: 38.9 V: 39.6 A-V: -0.717 ct: 3.805 0/ 0 17% 12% 0.0% 0 0 > > The message about timing may be a clue. I think timing issues should not affect the audio (it could be out of sync with the video). The ffmpeg output seems noisy and you're getting alsa buffer over/under runs. Try this: -f alsa -thread_queue_size 2048 or use 1024, if 2048 takes too long to allow the recording to start. This should do away with the message 'ALSA buffer xrun'. The mplayer output shows you have an audio stream alright and I bet ffprobe will show the same. Unless you're trying to record frequencies not audible by the human ear, I can think of one more thing. Maximise the Mic's capture volume and any boost settings available. Once I was trying to perform a voice recording using the built in microphone on a lesser quality laptop, not understanding why I couldn't hear any audio on playback. Well, I had to push the capture volume all the way up to 100% before I heard audio being played back. What a relief! I thought I was going deaf. LOL!! HTH. -- Regards, Mick
signature.asc
Description: This is a digitally signed message part.

