Search code examples
videocompressionvideo-capturevideo-encodingcodec

Choosing a video codec for screen recording


I'm doing a series of tutorials by recording the screen and my voice. Just as PNG works best for screenshots, while JPEG is better suited for photographs (although lossy), which video encoding & container formats are better for screen recording?

Please provide suggestions for both:

  1. The Master copy (for editing & archiving. (Almost) Lossless)
  2. Distribution copies (high compression with acceptable loss)

Points to consider:

  • High quality video with on-screen text being legible
  • Good compression. I guess both inter-frame & intra-frame compression will be effective.
  • Please mention recommended values of configurable parameters like frame rate, compression level, etc.
  • Closed captions to be supported (not "hard-coded" onto the video). I'm inclining towards .srt format
  • Viewable on Windows, Linux & MacOS

Solution

  • Master copy
    Lossless - HUFFYUV in AVI is a good option.
    Lossy - MJPEG (series of JPEG) in AVI is a good option, where each frame will be independently encoded. The editing will be faster.

    Distribution
    Video codec - Use either H.264 video (not free) or VP8 (free video codec by Google). You should use codec with inter frame compression as screen recording tends to have a lot of similarity across frames, hence allowing for a better compression. Both VP8 and H.264 support inter compression where as MJPEG does not.

    File format - Depending on video codec, you can use either MP4 or MKV file format. H.264 is more often encapsulated in MP4 container and VP8 in MKV. Google WebM format is subset of MKV format.

    Subtitles - SRT is good choice for external subtitles. MKV supports internal subtitles if you want to embed subtitles inside MKV file as a separate stream.

    Frame rate - 24 fps is good enough frame rate for your use case. You can actually use even lower frame rates if needed.

    Bitrate/Compression level - Depends on resolution of the video. You should be able find good tutorials which provide which bitrate is best for given resolution.

    Support - MKV with VP8 will play on Windows (Windows Media player) and Linux provided necessary software is installed. VLC Player is available on both Windows and Linux and plays MKV with VP8 without any issues.