fixed rendering issues with non-30 fps

This commit is contained in:
2026-01-14 04:36:24 -05:00
parent 579ca08181
commit 3b551abb8a
3 changed files with 6 additions and 6 deletions

View File

@@ -147,7 +147,7 @@ namespace anm2ed::imgui
} }
else else
{ {
if (animation_render(ffmpegPath, path, renderFrames, audioStream, (render::Type)type, size, anm2.info.fps)) if (animation_render(ffmpegPath, path, renderFrames, audioStream, (render::Type)type, size))
{ {
toasts.push(std::vformat(localize.get(TOAST_EXPORT_RENDERED_ANIMATION), std::make_format_args(pathString))); toasts.push(std::vformat(localize.get(TOAST_EXPORT_RENDERED_ANIMATION), std::make_format_args(pathString)));
logger.info(std::vformat(localize.get(TOAST_EXPORT_RENDERED_ANIMATION, anm2ed::ENGLISH), logger.info(std::vformat(localize.get(TOAST_EXPORT_RENDERED_ANIMATION, anm2ed::ENGLISH),

View File

@@ -19,9 +19,9 @@ using namespace glm;
namespace anm2ed namespace anm2ed
{ {
bool animation_render(const std::filesystem::path& ffmpegPath, const std::filesystem::path& path, bool animation_render(const std::filesystem::path& ffmpegPath, const std::filesystem::path& path,
std::vector<Texture>& frames, AudioStream& audioStream, render::Type type, ivec2 size, int fps) std::vector<Texture>& frames, AudioStream& audioStream, render::Type type, ivec2 size)
{ {
if (frames.empty() || size.x <= 0 || size.y <= 0 || fps <= 0 || ffmpegPath.empty() || path.empty()) return false; if (frames.empty() || size.x <= 0 || size.y <= 0 || ffmpegPath.empty() || path.empty()) return false;
auto pathString = path::to_utf8(path); auto pathString = path::to_utf8(path);
auto ffmpegPathString = path::to_utf8(ffmpegPath); auto ffmpegPathString = path::to_utf8(ffmpegPath);
@@ -85,8 +85,8 @@ namespace anm2ed
} }
} }
command = std::format("\"{0}\" -y -f rawvideo -pix_fmt rgba -s {1}x{2} -r {3} -i pipe:0", ffmpegPathString, size.x, command = std::format("\"{0}\" -y -f rawvideo -pix_fmt rgba -s {1}x{2} -r 30 -i pipe:0", ffmpegPathString, size.x,
size.y, fps); size.y);
if (!audioInputArguments.empty()) command += " " + audioInputArguments; if (!audioInputArguments.empty()) command += " " + audioInputArguments;

View File

@@ -37,5 +37,5 @@ namespace anm2ed
{ {
std::filesystem::path ffmpeg_log_path(); std::filesystem::path ffmpeg_log_path();
bool animation_render(const std::filesystem::path&, const std::filesystem::path&, std::vector<resource::Texture>&, bool animation_render(const std::filesystem::path&, const std::filesystem::path&, std::vector<resource::Texture>&,
AudioStream&, render::Type, glm::ivec2, int); AudioStream&, render::Type, glm::ivec2);
} }