Refactor, Vsync, FFmpeg fixes

This commit is contained in:
2025-08-15 12:18:57 -04:00
parent e8094a19c4
commit a665023626
15 changed files with 149 additions and 78 deletions

View File

@@ -6,19 +6,25 @@
#define FFMPEG_POPEN_ERROR "popen() (for FFmpeg) failed!\n{}"
static constexpr const char* FFMPEG_GIF_FORMAT =
"\"{0}\" -y "
"{0} -y "
"-f rawvideo -pix_fmt rgba -s {1}x{2} -r {3} -i pipe:0 "
"-lavfi \"split[s0][s1];"
"[s0]palettegen=stats_mode=full[p];"
"[s1][p]paletteuse=dither=floyd_steinberg\" "
"-loop 0 \"{4}\"";
"-loop 0 {4}";
static constexpr const char* FFMPEG_WEBM_FORMAT =
"\"{0}\" -y "
"{0} -y "
"-f rawvideo -pix_fmt rgba -s {1}x{2} -r {3} -i pipe:0 "
"-c:v libvpx-vp9 -crf 30 -b:v 0 -pix_fmt yuva420p -row-mt 1 -threads 0 -speed 2 "
"-auto-alt-ref 0 -an \"{4}\"";
"-auto-alt-ref 0 -an {4}";
static constexpr const char* FFMPEG_MP4_FORMAT =
"{0} -y "
"-f rawvideo -pix_fmt rgba -s {1}x{2} -r {3} -i pipe:0 "
"-vf \"format=yuv420p,scale=trunc(iw/2)*2:trunc(ih/2)*2\" "
"-c:v libx265 -crf 20 -preset slow "
"-tag:v hvc1 -movflags +faststart -an {4}";
bool
ffmpeg_render