[FFmpeg-user] Fwd: Cannot capture audio in screen recording

Abhijit Nathwani abhijit.nathwani at gmail.com
Tue Sep 11 13:16:11 EEST 2018


Hi please find the inline content below.

> ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg
developers

This is a very old version, please consider using a recent one. (But
this shouldn't be the issue.)

> Input #1, alsa, from 'hw:0,1,0':
>   Duration: N/A, start: 1536642371.115637, bitrate: 1536 kb/s
>     Stream #1:0: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s

The input device at least works.

> Output #0, mp4, to '/home/abhijit/test_1036.mp4':
[...]
>     Stream #0:1: Audio: aac ([64][0][0][0] / 0x0040), 44100 Hz, stereo,
fltp, 128 kb/s

ffmpeg's output file should contain a proper AAC stream.

> The video file properties has some audio buffers but still no audio
> on the speakers.

Could it be that your ALSA capture device's recording is muted?
> I don't know. How to ensure that?

What does
$ ffmpeg -i /home/abhijit/test_1036.mp4 -map 0:a -af volumedetect -f null -
say, i.e. what is the actual volume?
> abhijit at AHMCPU2092:~$ ffmpeg -i /home/abhijit/test_1036.mp4 -map 0:a -af
volumedetect -f null -
ffmpeg version 2.8.15-0ubuntu0.16.04.1 Copyright (c) 2000-2018 the FFmpeg
developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.10) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1
--build-suffix=-ffmpeg --toolchain=hardened
--libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu
--cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping
--disable-decoder=libopenjpeg --disable-decoder=libschroedinger
--enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libflite --enable-libfontconfig
--enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm
--enable-libmodplug --enable-libmp3lame --enable-libopenjpeg
--enable-libopus --enable-libpulse --enable-librtmp
--enable-libschroedinger --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora
--enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack
--enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi
--enable-openal --enable-opengl --enable-x11grab --enable-libdc1394
--enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264
--enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/abhijit/test_1036.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.40.101
  Duration: 00:00:32.88, start: 0.023220, bitrate: 993 kb/s
    Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p,
1280x720, 983 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz,
stereo, fltp, 2 kb/s (default)
    Metadata:
      handler_name    : SoundHandler
Output #0, null, to 'pipe:':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf56.40.101
    Stream #0:0(und): Audio: pcm_s16le, 44100 Hz, stereo, s16, 1411 kb/s
(default)
    Metadata:
      handler_name    : SoundHandler
      encoder         : Lavc56.60.100 pcm_s16le
Stream mapping:
  Stream #0:1 -> #0:0 (aac (native) -> pcm_s16le (native))
Press [q] to stop, [?] for help
size=N/A time=00:00:32.88 bitrate=N/A
video:0kB audio:5664kB subtitle:0kB other streams:0kB global headers:0kB
muxing overhead: unknown
[Parsed_volumedetect_0 @ 0x12b2ac0] n_samples: 2899968
[Parsed_volumedetect_0 @ 0x12b2ac0] mean_volume: -91.0 dB
[Parsed_volumedetect_0 @ 0x12b2ac0] max_volume: -91.0 dB
[Parsed_volumedetect_0 @ 0x12b2ac0] histogram_91db: 2899968
abhijit at AHMCPU2092:~$


Does arecord give you a proper audio file where you can hear the sound?
> When I run arecord with default device,
 $ arecord -d 10 /tmp/test-mic.wav ,
 this records from my microphone and plays well. When I specify the device
with "hw:", like,
$ arecord -D hw:0,1,0 -d 10 -f S16_LE /tmp/test-mic3.wav
, I don't hear any audio from my microphone nor the youtube player.

Thanks,
Abhijit

_______________________________________________
ffmpeg-user mailing list
ffmpeg-user at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-user mailing list