depot/third_party/nixpkgs/pkgs/by-name/mu/music-assistant/ffmpeg.patch
Default email f34ce41345 Project import generated by Copybara.
GitOrigin-RevId: b73c2221a46c13557b1b3be9c2070cc42cf01eb3
2024-07-27 08:49:29 +02:00

71 lines
2.4 KiB
Diff

diff --git a/music_assistant/server/helpers/audio.py b/music_assistant/server/helpers/audio.py
index 42011923..1e5dc112 100644
--- a/music_assistant/server/helpers/audio.py
+++ b/music_assistant/server/helpers/audio.py
@@ -218,7 +218,7 @@ async def crossfade_pcm_parts(
await outfile.write(fade_out_part)
args = [
# generic args
- "ffmpeg",
+ "@ffmpeg@",
"-hide_banner",
"-loglevel",
"quiet",
@@ -281,7 +281,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(),
@@ -823,7 +823,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
@@ -877,7 +877,7 @@ async def get_silence(
return
# use ffmpeg for all other encodings
args = [
- "ffmpeg",
+ "@ffmpeg@",
"-hide_banner",
"-loglevel",
"quiet",
@@ -971,7 +971,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 dc38e4c0..f4f3e2fe 100644
--- a/music_assistant/server/helpers/tags.py
+++ b/music_assistant/server/helpers/tags.py
@@ -368,7 +368,7 @@ async def parse_tags(
file_path = input_file if isinstance(input_file, str) else "-"
args = (
- "ffprobe",
+ "@ffprobe@",
"-hide_banner",
"-loglevel",
"fatal",
@@ -440,7 +440,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",