From 8df5cf3be0df8655fb9d91bcb36911dd2cc5b672 Mon Sep 17 00:00:00 2001 From: Broque Thomas <26755000+Nezreka@users.noreply.github.com> Date: Sat, 18 Apr 2026 08:57:21 -0700 Subject: [PATCH] Fix lossy copy conversion failing on FLACs with embedded cover art Added -vn flag to all codec ffmpeg commands (MP3, Opus, AAC) to strip video/image streams during conversion. Embedded cover art in FLAC files caused ffmpeg to fail when the output muxer couldn't handle the image stream, producing 0KB output files. Cover art is re-embedded afterwards by Mutagen. --- web_server.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/web_server.py b/web_server.py index 92a6b444..ef680b97 100644 --- a/web_server.py +++ b/web_server.py @@ -18402,10 +18402,12 @@ def _create_lossy_copy(final_path): bitrate = '256' # Codec configuration: (ffmpeg_codec, extension, quality_label, extra_args) + # -vn strips video/image streams (embedded cover art) which can cause + # conversion failures when the output muxer can't handle image streams codec_map = { - 'mp3': ('libmp3lame', '.mp3', f'MP3-{bitrate}', ['-id3v2_version', '3']), - 'opus': ('libopus', '.opus', f'OPUS-{bitrate}', ['-map', '0:a', '-vbr', 'on']), - 'aac': ('aac', '.m4a', f'AAC-{bitrate}', ['-movflags', '+faststart']), + 'mp3': ('libmp3lame', '.mp3', f'MP3-{bitrate}', ['-vn', '-id3v2_version', '3']), + 'opus': ('libopus', '.opus', f'OPUS-{bitrate}', ['-vn', '-map', '0:a', '-vbr', 'on']), + 'aac': ('aac', '.m4a', f'AAC-{bitrate}', ['-vn', '-movflags', '+faststart']), } if codec not in codec_map: