The latest Arm Mac devices have built-in hardware encoders for common video codecs such as HEVC (H.265) and H.264, the popular x265 and x264 libraries provide a software implementation but this can be slow. As an example, the tech specs for an M1 MacBook Pro says it can: