Skip to content

Instantly share code, notes, and snippets.

@kayru
Created July 23, 2018 15:10
Show Gist options
  • Save kayru/f929714c483f0b881d4830b0983bfb4e to your computer and use it in GitHub Desktop.
Save kayru/f929714c483f0b881d4830b0983bfb4e to your computer and use it in GitHub Desktop.
ffmpeg pipe
ffmpegCmd << "ffmpeg -r 60 -f rawvideo -pix_fmt rgba "
<< "-s " << FrameWidth << "x" << FrameHeight << " "
<< "-i - -preset fast -y -pix_fmt yuv420p -crf 21 " << CaptureVideoPath;
ffmpegPipe = _popen(ffmpegCmd, "wb");
while(rendering)
{
fwrite(framePixels, frameSizeInBytes, 1, ffmpegPipe);
}
_pclose(app->m_ffmpegPipe);
@kayru
Copy link
Author

kayru commented Jul 23, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment