fixed rendering issues with non-30 fps
This commit is contained in:
@@ -147,7 +147,7 @@ namespace anm2ed::imgui
|
||||
}
|
||||
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)));
|
||||
logger.info(std::vformat(localize.get(TOAST_EXPORT_RENDERED_ANIMATION, anm2ed::ENGLISH),
|
||||
|
||||
@@ -19,9 +19,9 @@ using namespace glm;
|
||||
namespace anm2ed
|
||||
{
|
||||
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 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,
|
||||
size.y, fps);
|
||||
command = std::format("\"{0}\" -y -f rawvideo -pix_fmt rgba -s {1}x{2} -r 30 -i pipe:0", ffmpegPathString, size.x,
|
||||
size.y);
|
||||
|
||||
if (!audioInputArguments.empty()) command += " " + audioInputArguments;
|
||||
|
||||
|
||||
@@ -37,5 +37,5 @@ namespace anm2ed
|
||||
{
|
||||
std::filesystem::path ffmpeg_log_path();
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user