Exporting high quality video from windows demo/intro

category: code [glöplog]
Hi all

I'm looking for some advice on creating high-quality video from my demos/intros on Windows 10. These are for OpenGL based prods that I've created myself, so I am able to hijack the code on each frame render and export a still or something like that. Does anyone know what the current best practice is please? Should I export a ton of single HQ still frames and then combine them or does it make more sense to handle it another way (exporting uncompressed video or whatever) using a third party library or something? The prods will all be C++ based and I'm running Windows 10.

Many thanks in advance for any tips. Thanks very much :)
added on the 2020-05-15 06:56:56 by raizor raizor
added on the 2020-05-15 09:22:47 by hfr hfr
I just dump all frames (at fixed framerate obviously when intro is in dumper mode) as hq jpegs in a big file, and when done use ffmpeg to mux it with the raw audio file (that debug builds are using anyway) and encode it properly. ffmpeg commandline ala:
Code:ffmpeg -r 60 -vcodec mjpeg -i capture.mjpeg -f s16le -ar 44100 -ac 2 -i music.raw -t 0:03:23 -vcodec libx264 -threads 0 -acodec libmp3lame -ab 160000 -b 28000000 bla.mp4
added on the 2020-05-15 11:26:49 by Psycho Psycho
What Psycho said, plus a few additions:

- If you don't want to store raw images and don't want recompression, you could either dump the raw frames to stdout and pipe the output to ffmpeg (it sounds like the 60s but works :), or check out libavcodec/libavformat which is ffmpeg in C API form and actually not that hard to use if all you want to do is encode a single video stream to a file. (really, mux the soundtrack in afterwards)

- ffmpeg is really good at hardware accelerated encoding nowadays, and HEVC also works well. If you've got a current GPU, these command line options give you really good quality at faster than realtime speed:
Code:-c:v hevc_nvenc -rc:v vbr_hq -cq:v 20 -qmin 20 -qmax 20 -b:v 0 -pix_fmt yuv420p

(change the 20 to adjust quality; the lower the better)
added on the 2020-05-15 11:38:09 by kb_ kb_
use AV1 codec, because future!
added on the 2020-05-15 12:48:31 by wysiwtf wysiwtf
You guys are awesome, thank you! I think I've got all the answers now :)
added on the 2020-05-15 12:59:12 by raizor raizor