Menu

VideoEncoding

Bruno Herbelin

Video Recording in GLMixer

Select Codec (and quality)

Select recording format and codec:

The most standard video codec is H264: it is recommended for GLMixer.

Here is a list of possible encoding codecs:

  • H.264 (MPEG-4 AVC) : standard compromise for speed and quality.
  • HEVC (H265): better compromise for speed and quality.
  • WebM (VP9) : constant visual quality, small file size.
  • Apple ProRes : priority to visual quality, large file size.
  • MPEG-4 (DivX): old classic, good compromise.
  • MPEG-1 and 2 : ancient classics, not performant.
  • Windows Media and Flash Video : here for legacy and portability.
  • FF Video : ffmpeg lossless (YUV444), well balanced compromise.
  • Rawvideo: lossless (RGB), very large files.

Selection of quality factor for some codecs:

Quality AUTO is recommended for recording. It is a well-ballanced compromize for performance (speed for encoding), file size (between low and medium), and visual quality (almost visualy lossless in most cases). It is somewhere between LOW and MEDIUM.

The four categories of quality are defined by these criteria:

  • AUTO : follows reccomendations for good visual quality and efficient bitrate. Encoding should be efficient in real time.
  • LOW : small file size in priority, with a low bitrate, but visually poor quality. Encoding should be efficient in real time.
  • MEDIUM : attempt at a very high quality, with acceptable file size and bitrate. Better quality than AUTO for exigent video content. Encoding should still be efficient in real time.
  • HIGH : best visual quality in priority, with higher pixel format (for high fidelity color representation), but large file size and high bitrate. Encoding is slow and might not be possible if your machine is not powerfull enough.

Here is a list of encoding codecs allowing the selection of quality:

  • H264 : constant quality mode, variable bitrate, YUV420P pixel format, YUV444P in high quality.
  • HEVC : constant quality mode, variable bitrate, YUV420P pixel format, YUV444P in high quality.
  • WebM VP9 : fixed visual quality, variable bitrate, YUV420P pixel format, YUV444P in high quality.
  • Apple Prores 422: fixed visual quality, variable bitrate, YUV422 pixel format.
  • MPEG-4 : limited constant bit rate, YUV420P pixel format.

Example: YouTube format: H264 Medium.

Hardware acceleration

On machines running NVidia Graphics card, hardware GPU accelerated encoding is selected by default under Linux and Windows (not available under OSX).
GLMixer uses ffmpeg implementation of NVidia Video Codec SDK for encoding and decoding.

Select Frame rate and Buffer Size

Choosing the Frame Rate

For standard and portable video, select 25 or 30 fps.

Frame rates of 20, 40 and 50 fps are also possible. The higher the frame rate, the smoother the movement & the best quality for content with abrupt change.
High 60 fps is often an overkill, but necessary for some fast pace video.

Lower frame rates (20, 10, 5, 2 and 1 fps) are rather for visual effects and time-laps (e.g. record at 1fps and replay the video at speed x10).

Quality vs. Frame rate : performance compromise

High frame rate and high quality are not always compatible : you shall test with your machine to know what works.

Encoding and compressing each captured frame takes processing power to your computer. Depending on your hardware, you might not be able to record at a the desired frame rate: in this case, the recording will not stop, but some frames will be dropped, making 'holes' into your video. If several frames are dropped, a warning dialog asks you if you want to keep the video anyway.

It is recommended to record at a frame rate bellow a comfortable rendering frame rate. E.g. if your rendering is running smoothly at 50fps, it is safe to record at 30fps. If your computer cannot cope already with 30fps for the rendering, it will probably not be able to record at 30fps (so you can try at 25).

Choosing a buffer size

A small buffer of 200 MB (default) should be sufficient for all recordings.

First and foremost, make sure your computer has enough RAM available (GLMixer cannot test your system). If you ask for 1GB of buffer and ran out of memory, the computer might freeze and require a hard reboot.

Large buffer is useful to record short sequences in very high quality or very high frame rate if your computer does not manage to record on the fly. In this case, all the recording is put into RAM, and the encoding and saving will be done after you stop the recorder. You will then wait untill the encoding is finished.

File Size

Here is a test for a 10 s recording, 1920x1080 (Full HD), at 30fps

Codec Quality File size
H264 Auto 32.2 MB
Low 13.5 MB
Medium 62.6 MB
High 248.6 MB
HEVC Auto 21.9 MB
Low 9.7 MB
Medium 50.7 MB
High 88.3 MB
WebM VP9 Auto 16.6 MB
Low 12.1 MB
Medium 26.8 MB
High 41.2 MB
ProRes Auto 155.6 MB
Low 111.9 MB
Medium 280.3 MB
High 375.4 MB
MPEG-4 Auto 30.5 MB
Low 10.5 MB
Medium 43.9 MB
High 69.4 MB
MPEG-2 28.5 MB
MPEG-1 12.0 MB
Windows Media Video 8 30.8 MB
Flash Video (Sorenson) 30.4 MB
FF Video #1 404.5 MB
Rawvideo (RGB) 1.9 GB

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.