Optimizing your video content is crucial for ensuring a smooth and fast-loading experience for users.
The webvids
terminal app streamlines the process of converting videos into efficient x265 and AV1 formats which deliver high-quality video with minimal bandwidth across a wide range of browsers.
Just adjust the CRF to your liking and let it rip. You can also use the --speed
flag to adjust the processing demands on higher or lower-end systems.
After conversion, you'll have a folder named optimized
in your current directory with the WebM and MP4 video files.
Use source
tags to include both in your HTML:
<video controls>
<source type="video/webm" src="output.webm" />
<source type="video/mp4" src="output.mp4" />
</video>
It's a very straightforward process compared to ffmpeg
or HandBrake, and guarantees a good result that works in all major browsers.
Check out the GitHub repo here: https://github.com/henrygd/webvids