Additional logging + FFMpeg changes; ffmpeg output will be in the log now

This commit is contained in:
2025-08-15 18:03:45 -04:00
parent 8388fd5d99
commit afbaf2bc65
6 changed files with 43 additions and 12 deletions

View File

@@ -30,20 +30,33 @@ ffmpeg_render
break;
}
// ffmpeg output will be piped into the log
std::string logOutput = " 2>> \"" + log_path_get() + "\"";
#if _WIN32
command = string_quote(command);
command = string_quote(command) + logOutput;
#else
command += logOutput;
#endif
log_command(command);
FILE* fp = POPEN(command.c_str(), PWRITE_MODE);
if (!fp)
{
log_info(std::format(FFMPEG_POPEN_ERROR, strerror(errno)));
log_error(std::format(FFMPEG_POPEN_ERROR, strerror(errno)));
return false;
}
size_t frameBytes = size.x * size.y * TEXTURE_CHANNELS;
// supposedly, might help with video corruption issues on windows?
#if _WIN32
_setmode(_fileno(stdout), _O_BINARY);
#endif
for (const auto& frame : frames)
{
std::vector<u8> rgba = texture_download(&frame);