FWGS / xash3d-fwgs

Xash3D FWGS engine.
1.51k stars 225 forks source link

Remove AVI, add standardized some codec and container support #817

Open a1batross opened 2 years ago

a1batross commented 2 years ago

Xash3D engine supports video playback.

Unfortunately for us, the code is known to be tied to Windows system codecs. In theory, it allows game creators to use any codec they like to. However, for eight years there was no a brave enough person to bring some universal decoder library, like ffmpeg, which is 3-4x times heavier and more complex than the engine itself.

My decision is to drop AVI support completely and instead provide a popular container and codec support, to make it easier for modders to use the engine functionality.

I think that's adding support for WebM container and AV1 codec is good for future perspective. WebM is highly popular, and almost any video software should support it at this time. AV1 video codec on the other hand is a new codec introduced few years ago, that have better compression compared to VP9. My only concern is software decoding, it must be efficient. Support for hardware decoding would be nice, but it's an out of scope and can be discussed later when this issue will be resolved.

SNMetamorph commented 2 years ago

Will be this functionality expandable? In other words, will it be possible to add support for other formats/codecs on mod side?

a1batross commented 2 years ago

Let's make the prototype first.

mittorn commented 2 years ago

From wikipedia: WebM: as a matter of formality, AV1 has not been sanctioned into the subset of Matroska known as WebM as of late 2019 also: https://www.webmproject.org/docs/container/ So webm subset seems does not cover AV1 at all

a1batross commented 2 years ago

VP9 seems to be a better choice for now. Older codecs than VP9 will provide worse compression, but newer is not yet implement in hardware. And there is no reason to depend on proprietary codecs like AVC or HEVC.

+ why we should limit ourselves to subset of Matroska when we can just use Matroska itself?

OlegAckbar commented 3 weeks ago

For me intro videos aren't playing even though logo is working. I'm running 64-bit client with ffmpeg enabled. Neither webm nor avi works. Is it supposed to be like that on Linux?

SNMetamorph commented 3 weeks ago

For me intro videos aren't playing even though logo is working. I'm running 64-bit client with ffmpeg enabled. Neither webm nor avi works. Is it supposed to be like that on Linux?

For now it's not working on platforms rather than Windows. But even for Windows - only .avi files with Cinepak codec are supported. Though this will be changed in future, I don't know which exact final solution will be.