From 0ba585511c67c3d5615d2d7769989518eb07b21f Mon Sep 17 00:00:00 2001 From: shweet Date: Wed, 17 Dec 2025 23:09:58 -0500 Subject: [PATCH] windows moment --- src/render.cpp | 16 ++++++++-------- src/render.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/render.cpp b/src/render.cpp index 9f5e6b2..107d86e 100644 --- a/src/render.cpp +++ b/src/render.cpp @@ -16,8 +16,8 @@ using namespace glm; namespace anm2ed { - bool animation_render(const std::string& ffmpegPath, const std::string& path, std::vector& frames, - AudioStream& audioStream, render::Type type, ivec2 size, int fps) + bool animation_render(const std::filesystem::path& ffmpegPath, const std::filesystem::path& path, + std::vector& frames, AudioStream& audioStream, render::Type type, ivec2 size, int fps) { if (frames.empty() || size.x <= 0 || size.y <= 0 || fps <= 0 || ffmpegPath.empty() || path.empty()) return false; @@ -38,7 +38,7 @@ namespace anm2ed if (type != render::GIF && !audioStream.stream.empty() && audioStream.spec.freq > 0 && audioStream.spec.channels > 0) { - audioPath = std::filesystem::temp_directory_path() / std::format("{}.f32", path); + audioPath = std::filesystem::temp_directory_path() / std::format("{}.f32", path.string()); std::ofstream audioFile(audioPath, std::ios::binary); @@ -71,8 +71,8 @@ namespace anm2ed } } - command = std::format("\"{0}\" -y -f rawvideo -pix_fmt rgba -s {1}x{2} -r {3} -i pipe:0", ffmpegPath, size.x, - size.y, fps); + command = std::format("\"{0}\" -y -f rawvideo -pix_fmt rgba -s {1}x{2} -r {3} -i pipe:0", ffmpegPath.string(), + size.x, size.y, fps); if (!audioInputArguments.empty()) command += " " + audioInputArguments; @@ -82,18 +82,18 @@ namespace anm2ed command += " -lavfi \"split[s0][s1];[s0]palettegen=stats_mode=full[p];[s1][p]paletteuse=dither=floyd_steinberg\"" " -loop 0"; - command += std::format(" \"{}\"", path); + command += std::format(" \"{}\"", path.string()); break; case render::WEBM: command += " -c:v libvpx-vp9 -crf 30 -b:v 0 -pix_fmt yuva420p -row-mt 1 -threads 0 -speed 2 -auto-alt-ref 0"; if (!audioOutputArguments.empty()) command += " " + audioOutputArguments; - command += std::format(" \"{}\"", path); + command += std::format(" \"{}\"", path.string()); break; case render::MP4: command += " -vf \"format=yuv420p,scale=trunc(iw/2)*2:trunc(ih/2)*2\" -c:v libx265 -crf 20 -preset slow" " -tag:v hvc1 -movflags +faststart"; if (!audioOutputArguments.empty()) command += " " + audioOutputArguments; - command += std::format(" \"{}\"", path); + command += std::format(" \"{}\"", path.string()); break; default: return false; diff --git a/src/render.h b/src/render.h index b72d861..5abc2ae 100644 --- a/src/render.h +++ b/src/render.h @@ -36,6 +36,6 @@ namespace anm2ed::render namespace anm2ed { std::filesystem::path ffmpeg_log_path(); - bool animation_render(const std::string&, const std::string&, std::vector&, AudioStream&, - render::Type, glm::ivec2, int); + bool animation_render(const std::filesystem::path&, const std::filesystem::path&, std::vector&, + AudioStream&, render::Type, glm::ivec2, int); } \ No newline at end of file