steamcompmgr: add basic handling of system() ffmpeg call

This commit is contained in:
Joaquín Ignacio Aramendía 2023-01-05 08:11:42 -03:00 committed by GitHub
parent 054dcec856
commit 45c9ffd088
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2116,9 +2116,15 @@ paint_all(bool async)
char cmd[4096];
sprintf(cmd, "ffmpeg -f rawvideo -pixel_format nv12 -video_size %dx%d -i %s %s_encoded.png", pCaptureTexture->width(), pCaptureTexture->height(), pTimeBuffer, pTimeBuffer);
system(cmd);
int ret = system(cmd);
xwm_log.infof("Screenshot saved to %s", pTimeBuffer);
/* Above call may fail, ffmpeg returns 0 on success */
if (ret) {
xwm_log.infof("Ffmpeg call return status %i", ret);
xwm_log.errorf( "Failed to save screenshot to %s", pTimeBuffer );
} else {
xwm_log.infof("Screenshot saved to %s", pTimeBuffer);
}
}
else
{