depot/third_party/nixpkgs/pkgs/by-name/mu/music-assistant/ffmpeg.patch
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

71 lines
2.4 KiB
Diff

diff --git a/music_assistant/server/helpers/audio.py b/music_assistant/server/helpers/audio.py
index 6b7b5c8e..ec3b92d7 100644
--- a/music_assistant/server/helpers/audio.py
+++ b/music_assistant/server/helpers/audio.py
@@ -214,7 +214,7 @@ async def crossfade_pcm_parts(
await outfile.write(fade_out_part)
args = [
# generic args
- "ffmpeg",
+ "@ffmpeg@",
"-hide_banner",
"-loglevel",
"quiet",
@@ -277,7 +277,7 @@ async def strip_silence(
) -> bytes:
"""Strip silence from begin or end of pcm audio using ffmpeg."""
fmt = ContentType.from_bit_depth(bit_depth)
- args = ["ffmpeg", "-hide_banner", "-loglevel", "quiet"]
+ args = ["@ffmpeg@", "-hide_banner", "-loglevel", "quiet"]
args += [
"-acodec",
fmt.name.lower(),
@@ -824,7 +824,7 @@ async def get_ffmpeg_stream(
async def check_audio_support() -> tuple[bool, bool, str]:
"""Check if ffmpeg is present (with/without libsoxr support)."""
# check for FFmpeg presence
- returncode, output = await check_output("ffmpeg", "-version")
+ returncode, output = await check_output("@ffmpeg@", "-version")
ffmpeg_present = returncode == 0 and "FFmpeg" in output.decode()
# use globals as in-memory cache
@@ -878,7 +878,7 @@ async def get_silence(
return
# use ffmpeg for all other encodings
args = [
- "ffmpeg",
+ "@ffmpeg@",
"-hide_banner",
"-loglevel",
"quiet",
@@ -972,7 +972,7 @@ def get_ffmpeg_args(
# generic args
generic_args = [
- "ffmpeg",
+ "@ffmpeg@",
"-hide_banner",
"-loglevel",
loglevel,
diff --git a/music_assistant/server/helpers/tags.py b/music_assistant/server/helpers/tags.py
index d17b55f6..b7b56c04 100644
--- a/music_assistant/server/helpers/tags.py
+++ b/music_assistant/server/helpers/tags.py
@@ -380,7 +380,7 @@ async def parse_tags(
file_path = input_file if isinstance(input_file, str) else "-"
args = (
- "ffprobe",
+ "@ffprobe@",
"-hide_banner",
"-loglevel",
"fatal",
@@ -471,7 +471,7 @@ async def get_embedded_image(input_file: str | AsyncGenerator[bytes, None]) -> b
"""
file_path = input_file if isinstance(input_file, str) else "-"
args = (
- "ffmpeg",
+ "@ffmpeg@",
"-hide_banner",
"-loglevel",
"error",