Merge pull request #668 from jotalevi/hide-ffmpeg-flash

fix(ffmpeg): prevent terminal window flash on Windows during media conversion
This commit is contained in:
exislow
2025-11-29 17:05:03 +01:00
committed by GitHub
2 changed files with 15 additions and 0 deletions
+1
View File
@@ -1,4 +1,5 @@
docs/source docs/source
vs_code/
# From https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore # From https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
+14
View File
@@ -1689,14 +1689,21 @@ class Download:
pathlib.Path: Path to the converted MP4 file. pathlib.Path: Path to the converted MP4 file.
""" """
path_file_out: pathlib.Path = path_file.with_suffix(AudioExtensions.MP4) path_file_out: pathlib.Path = path_file.with_suffix(AudioExtensions.MP4)
self.fn_logger.debug(f"Converting video: {path_file.name} -> {path_file_out.name}")
ffmpeg = ( ffmpeg = (
FFmpeg(executable=self.settings.data.path_binary_ffmpeg) FFmpeg(executable=self.settings.data.path_binary_ffmpeg)
.option("y") .option("y")
.option("hide_banner")
.option("nostdin")
.input(url=path_file) .input(url=path_file)
.output(url=path_file_out, codec="copy", map=0, loglevel="quiet") .output(url=path_file_out, codec="copy", map=0, loglevel="quiet")
) )
ffmpeg.execute() ffmpeg.execute()
self.fn_logger.debug(f"Video conversion complete: {path_file_out.name}")
return path_file_out return path_file_out
@@ -1710,8 +1717,13 @@ class Download:
pathlib.Path: Path to the extracted FLAC file. pathlib.Path: Path to the extracted FLAC file.
""" """
path_media_out = path_media_src.with_suffix(AudioExtensions.FLAC) path_media_out = path_media_src.with_suffix(AudioExtensions.FLAC)
self.fn_logger.debug(f"Extracting FLAC: {path_media_src.name} -> {path_media_out.name}")
ffmpeg = ( ffmpeg = (
FFmpeg(executable=self.settings.data.path_binary_ffmpeg) FFmpeg(executable=self.settings.data.path_binary_ffmpeg)
.option("hide_banner")
.option("nostdin")
.input(url=path_media_src) .input(url=path_media_src)
.output( .output(
url=path_media_out, url=path_media_out,
@@ -1724,6 +1736,8 @@ class Download:
) )
ffmpeg.execute() ffmpeg.execute()
self.fn_logger.debug(f"FLAC extraction complete: {path_media_out.name}")
return path_media_out return path_media_out