If I capture desktop audio and record for a duration of 10-20 minutes, somewhere within that time there is a duration of around 1-2ms where the audio just drops to zero. The test case I am currently using is Audacity with a 20 minute long generated tone of 600Hz. I can save a copy of this audio file directly from audacity, but if I play it back and capture through OBS (to simulate a stream recording) there are audio drops. I detect this using
The following is the output from the OBS Log for this recording:
I can confirm from listening back to the audio that there is indeed an audio drop.
Does anyone know why I'm getting these random silences and how I can avoid them?
ffmpeg -i Filename.mp4 -af silencedetect=noise=0.001:duration=0.001 -f null -
which yields no silence detection from the directly exported audio, but from the OBS recording it yields
Code:
[silencedetect @ 0x556eab888640] silence_start: 279.914trate=N/A speed=16.1x
[silencedetect @ 0x556eab888640] silence_end: 279.915 | silence_duration: 0.00120833
[silencedetect @ 0x556eab888640] silence_start: 279.916
[silencedetect @ 0x556eab888640] silence_end: 279.92 | silence_duration: 0.00389583
[silencedetect @ 0x556eab888640] silence_start: 279.92
[silencedetect @ 0x556eab888640] silence_end: 279.924 | silence_duration: 0.00404167
[silencedetect @ 0x556eab888640] silence_start: 279.924
[silencedetect @ 0x556eab888640] silence_end: 279.932 | silence_duration: 0.00814583
Code:
10:35:09.874: CPU Name: AMD Ryzen 3 1300X Quad-Core Processor
10:35:09.874: CPU Speed: 3592.785MHz
10:35:09.874: Physical Cores: 4, Logical Cores: 4
10:35:09.874: Physical Memory: 7885MB Total, 6507MB Free
10:35:09.874: Kernel Version: Linux 5.14.2-arch1-2
10:35:09.874: Distribution: "Arch Linux" Unknown
10:35:09.874: Session Type: x11
10:35:09.874: Window System: X11.0, Vendor: The X.Org Foundation, Version: 1.20.13
10:35:09.875: Portable mode: false
10:35:09.921: OBS 27.0.1-2 (linux)
10:35:09.921: ---------------------------------
10:35:09.921: ---------------------------------
10:35:09.921: audio settings reset:
10:35:09.921: samples per sec: 48000
10:35:09.921: speakers: 2
10:35:09.923: ---------------------------------
10:35:09.923: Initializing OpenGL...
10:35:10.021: Loading up OpenGL on adapter NVIDIA Corporation NVIDIA GeForce GTX 750 Ti/PCIe/SSE2
10:35:10.021: OpenGL loaded successfully, version 3.3.0 NVIDIA 470.63.01, shading language 3.30 NVIDIA via Cg compiler
10:35:10.030: ---------------------------------
10:35:10.030: video settings reset:
10:35:10.030: base resolution: 1920x1080
10:35:10.030: output resolution: 1920x1080
10:35:10.030: downscale filter: Bilinear
10:35:10.030: fps: 30/1
10:35:10.030: format: I444
10:35:10.030: YUV mode: 709/Full
10:35:10.030: NV12 texture support not available
10:35:10.031: Audio monitoring device:
10:35:10.031: name: Default
10:35:10.031: id: default
10:35:10.031: ---------------------------------
10:35:10.032: Failed to load 'en-US' text for module: 'decklink-captions.so'
10:35:10.033: Failed to load 'en-US' text for module: 'decklink-ouput-ui.so'
10:35:10.106: A DeckLink iterator could not be created. The DeckLink drivers may not be installed
10:35:10.106: No blackmagic support
10:35:10.113: v4l2loopback not installed, virtual camera disabled
10:35:10.117: NVENC supported
10:35:10.117: FFMPEG VAAPI supported
10:35:10.125: ---------------------------------
10:35:10.125: Loaded Modules:
10:35:10.125: text-freetype2.so
10:35:10.125: sndio.so
10:35:10.125: rtmp-services.so
10:35:10.125: obs-x264.so
10:35:10.125: obs-transitions.so
10:35:10.125: obs-outputs.so
10:35:10.125: obs-libfdk.so
10:35:10.125: obs-filters.so
10:35:10.125: obs-ffmpeg.so
10:35:10.125: linux-v4l2.so
10:35:10.125: linux-pulseaudio.so
10:35:10.125: linux-jack.so
10:35:10.125: linux-decklink.so
10:35:10.125: linux-capture.so
10:35:10.125: linux-alsa.so
10:35:10.125: image-source.so
10:35:10.125: frontend-tools.so
10:35:10.125: decklink-ouput-ui.so
10:35:10.125: decklink-captions.so
10:35:10.125: ---------------------------------
10:35:10.125: ==== Startup complete ===============================================
10:35:10.128: All scene data cleared
10:35:10.128: ------------------------------------------------
10:35:10.133: pulse-input: Server name: 'pulseaudio 15.0'
10:35:10.134: pulse-input: Audio format: s32le, 48000 Hz, 2 channels
10:35:10.134: pulse-input: Started recording from 'alsa_output.pci-0000_09_00.1.hdmi-stereo-extra1.monitor'
10:35:10.134: [Loaded global audio device]: 'Desktop Audio'
10:35:10.134: pulse-input: Server name: 'pulseaudio 15.0'
10:35:10.134: pulse-input: An error occurred while getting the source info!
10:35:10.134: [Loaded global audio device]: 'Mic/Aux'
10:35:10.134: - filter: 'Expander' (expander_filter)
10:35:10.134: - filter: 'Noise Suppression' (noise_suppress_filter_v2)
10:35:10.134: - filter: 'Compressor' (compressor_filter)
10:35:10.135: xshm-input: Geometry 1920x1080 @ 1400,0
10:35:10.135: Switched to scene 'Scene 2'
10:35:10.135: ------------------------------------------------
10:35:10.136: Loaded scenes:
10:35:10.136: - scene 'Scene 2':
10:35:10.136: - source: 'Screen Capture (XSHM)' (xshm_input)
10:35:10.136: ------------------------------------------------
10:35:39.112: ---------------------------------
10:35:39.112: [NVENC encoder: 'recording_h264'] settings:
10:35:39.112: rate_control: CQP
10:35:39.112: bitrate: 0
10:35:39.112: cqp: 24
10:35:39.112: keyint: 250
10:35:39.112: preset: hq
10:35:39.112: profile: high
10:35:39.112: width: 1920
10:35:39.112: height: 1080
10:35:39.112: 2-pass: false
10:35:39.112: b-frames: 2
10:35:39.112: psycho-aq: 0
10:35:39.112: GPU: 0
10:35:39.112:
10:35:39.653: libfdk_aac encoder created
10:35:39.653: libfdk_aac bitrate: 128, channels: 2
10:35:39.665: ==== Recording Start ===============================================
10:35:39.665: [ffmpeg muxer: 'adv_file_output'] Writing file '/home/user/2021-09-16 10-35-39.mp4'...
10:43:41.687: [ffmpeg muxer: 'adv_file_output'] Output of file '/home/user/2021-09-16 10-35-39.mp4' stopped
10:43:41.687: Output 'adv_file_output': stopping
10:43:41.687: Output 'adv_file_output': Total frames output: 14425
10:43:41.687: Output 'adv_file_output': Total drawn frames: 14460
10:43:41.695: ==== Recording Stop ================================================
10:43:41.932: libfdk_aac encoder destroyed
I can confirm from listening back to the audio that there is indeed an audio drop.
Does anyone know why I'm getting these random silences and how I can avoid them?