Add support for embedding videos in documentation pages#9092
Add support for embedding videos in documentation pages#9092mhilbrunner merged 1 commit intogodotengine:masterfrom
Conversation
58fbfcb to
06c89b0
Compare
|
Are there any codec issues with this on Linux? I know some patented ones got turned off by default last year in several distros. EDIT: also how consistent is compression size for MP4? Because I know there is variation with images like webp (squoosh will get you a smaller lossless webp than krita). |
This is still an issue on Fedora out of the box (at least until late 2029), but pretty much everyone enables RPMFusion anyway as other places on the web will often use H.264 without any fallback. Other distributions don't have this issue and have H.264 support out of the box.
x264 is the most popular CPU-based encoder these days; it's what FFmpeg uses. If you record a MP4 directly from screen recording software, you'll want to re-encode it to get more efficient file sizes (real-time encoding always makes efficiency tradeoffs in favor of speed). |
|
It turns out VP9 is supported in iOS 17.4 and later, so we could actually use VP9 everywhere without a fallback: https://caniuse.com/webm This is a very recent development (VP8 is also supported, and so is Vorbis/Opus audio - not within the Ogg container though). This means iOS 17.4 isn't widely deployed yet, but by the time Godot 4.3 is released (if this PR isn't cherry-picked), I expect it to catch up somewhat. This means we can also support Linux distributions without RPMFusion enabled out of the box. VP9 is also more efficient than H.264, so it'll result in smaller file sizes or better quality at the same file size. |
|
I'd say go for VP9 then. |
06c89b0 to
ce4663e
Compare
Done. I've also updated the documentation image guidelines to add recommendations for creating videos for the documentation. |
This is more efficient than GIFs, animated PNGs or WebPs, while also providing controls and audio playback if needed.
ce4663e to
3e3bbde
Compare
|
The only thing I'm wary of here is adding another dependency, but it seems small and simple enough, hopefully. Let's merge and see if we run into any issues in practice on |
This is more efficient1 than GIFs, animated PNGs or WebPs, while also providing controls and audio playback if needed.
Ideally, we'd ship AV1 versions of the videos for more optimized file sizes, but macOS/iOS Safari only support these on very recent devices (there's no CPU decoding fallback). Therefore, we'll settle on VP9 for now, which is supported on all platforms (including iOS) since iOS 17.4 was recently released.
A video has been committed to replace the introductory GIF in the Prototyping levels with CSG page.
Footnotes
Not necessarily smaller in file size, but there's a potential to achieve much higher quality and smoother framerates. There's also more control over framerates compared to GIF – proper 30 FPS and 60 FPS are feasible with videos, not GIFs as they can only specify frame duration by 10 ms intervals. ↩