From 3b879f8d2c166a604847bbba5b476039fb9a3915 Mon Sep 17 00:00:00 2001 From: Jonathan Rampersad Date: Fri, 6 Jun 2025 09:43:37 -0400 Subject: [PATCH] BUGFIX: Could not write to tempfile --- setup.cfg | 2 +- src/surround_to_eac3/main.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index ce5f41f..d097611 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = surround-to-eac3 -version = 0.3.0 +version = 0.3.1 author = Jonathan Rampersad author_email = jonathan@jono-rams.work description = A CLI tool to transcode 5.1 audio in video files to E-AC3. diff --git a/src/surround_to_eac3/main.py b/src/surround_to_eac3/main.py index 531c4e7..598c086 100644 --- a/src/surround_to_eac3/main.py +++ b/src/surround_to_eac3/main.py @@ -107,6 +107,12 @@ def process_file_with_ffmpeg( output_audio_stream_ffmpeg_idx += 1 ffmpeg_cmd.extend(map_operations) + + if final_output_filepath.lower().endswith('.mkv'): + ffmpeg_cmd.extend(['-f', 'matroska']) + elif final_output_filepath.lower().endswith('.mp4'): + ffmpeg_cmd.extend(['-f', 'mp4']) + ffmpeg_cmd.extend(["-y", temp_output_filepath]) logs.append(f" ⚙️ Processing: '{base_filename}' -> '{output_filename}'")