Daemon icon indicating copy to clipboard operation
Daemon copied to clipboard

Candidates for a modern video codec suitable for both playing and recording

Open illwieckz opened this issue 1 year ago • 2 comments

The same way we have support for some modern formats like WebP and CRN alongside the legacy TGA format, we may want a modern codec alternative for playback and recording.

The usages

The Unvanquished game (including community content) has two usages:

  • videoMap playback on in-game surfaces.
  • Video recording of demos.

Dæmon-based games may have a third usage:

  • Cinematic playback.

What we have

videoMap playback is on a road to be working again with legacy RoQ format, with legacy limitations (max size being 256×256, no keyframe), see:

  • https://github.com/DaemonEngine/Daemon/pull/954

Video recording of demos writes AVI files with MJPEG video codec and no sound.

Cinematic playback was removed as it was broken, see

  • https://github.com/DaemonEngine/Daemon/pull/391

The OGM+Theora+Vorbis format was removed at the same time as it was broken and unsafe.

So we currently have code for:

  • RoQ as playback (videoMap)
  • AVI+MJPEG as recording (demo).

Candidates

We need a format usable for both playback and recording, it's better if it's not already obsolete and won't be in a short time, it's especially better if the codec has very high chance to live for very long and be like the codec for the next generations, because we don't want to maintain a modern codec alone, and we don't want to drop support in the future to data (maps, etc.) we may produce today.

It is considered good if the format is usable for both playback and recording, to limit the amount of libraries to deal with.

  • WebM+VP9+Opus: Matroska container with VP9 video codec and Opus audio codec.
  • WebM+AV1+Opus: Matroska container with AV1 video codec and Opus audio codec.

It looks like both MP4 and WebM are used out there for AV1, maybe WebM+AV1+Opus is a good way to go fro AV1.

It's possible to use other audio codecs than Opus with AV1 but Opus is good enough and widely used with videos and is a very good candidate for accompanying AV1. We already support Opus in the engine and use Opus with the game.

AV1 is meant to replace VP9 so it's probably a good idea to directly jump to AV1.

illwieckz avatar Nov 12 '23 08:11 illwieckz

Should recording be a priority? There are already lots of tools to record games, most of which will do the job better than if we implemented something in the engine... there's already OBS (or even ffmpeg screenrecording...)

DolceTriade avatar Nov 13 '23 07:11 DolceTriade

Not a priority. As you said, ffmpeg, OBS or even SimpleScreenRecorder do the job well.

@slipher mentioned this video recording usage recently so I mentioned it too.

illwieckz avatar Nov 13 '23 08:11 illwieckz