Skip to content

Garbled / distorted podcast audio #293

@greatwitenorth

Description

@greatwitenorth

When creating a podcast, the resulting podcast sounds distorted and garbled. For example:

3450bb02-05d1-48da-812a-50efc58e531a (1).mp3

When I listen to the individual audio clips they are fine:

8ed69cc9-8652-4196-ac5d-cf607a09b99d_0.mp3

Relevant version info:
surfsense_backend/pyproject.toml

[project]
name = "surf-new-backend"
version = "0.0.7"
description = "SurfSense Backend"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
...
"python-ffmpeg>=2.0.12",
...

Debugging steps:

  • I deactivated the code that deletes the temp audio files
  • I listened to the individual files. They are OK
  • I output the ffmpeg command that SurfSense is using to assemble the mp3. When I run the command on my local mac (using my local ffmpeg version 7.1.1 the resulting podcast sounds fine with no distortion.
  • I tried running the command in the docker container directly, but it says ffmpeg not found (presumably because it's using a python version from somewhere).
  • I checked the temp_audio files and they all seem to be using the same encoding and bitrate

8ed69cc9-8652-4196-ac5d-cf607a09b99d_0.mp3
8ed69cc9-8652-4196-ac5d-cf607a09b99d_1.mp3

Command I ran on my mac:

ffmpeg -y -filter_complex "[0:0][1:0][2:0][3:0][4:0][5:0][6:0][7:0][8:0][9:0][10:0][11:0][12:0][13:0][14:0][15:0]concat=n=15:v=0:a=1[outa]" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_0.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_1.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_2.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_3.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_4.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_5.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_6.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_7.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_8.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_9.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_10.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_11.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_12.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_13.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_14.mp3" \
-i "temp_audio/8ed69cc9-8652-4196-ac5d-cf607a09b99d_15.mp3" \
-map "[outa]" "podcasts/8ed69cc9-8652-4196-ac5d-cf607a09b99d_podcast-2.mp3"

My mac's local ffmpeg version info:

ffmpeg version 7.1.1 Copyright (c) 2000-2025 the FFmpeg developers
  built with Apple clang version 17.0.0 (clang-1700.0.13.3)
  configuration: --prefix=/opt/homebrew/Cellar/ffmpeg/7.1.1_3 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox --enable-neon
  libavutil      59. 39.100 / 59. 39.100
  libavcodec     61. 19.101 / 61. 19.101
  libavformat    61.  7.100 / 61.  7.100
  libavdevice    61.  3.100 / 61.  3.100
  libavfilter    10.  4.100 / 10.  4.100
  libswscale      8.  3.100 /  8.  3.100
  libswresample   5.  3.100 /  5.  3.100
  libpostproc    58.  3.100 / 58.  3.100

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions