libx264 crashes most commonly occur on systems with unstable overclocks. If your system is overclocked, set it back to stock clocks for testing purposes. If the issue goes away, you need to stabilize your overclock or leave it at stock speeds.
As you are on a Ryzen-based system, also check for a motherboard BIOS update with your mobo manufacturer. CPU microcode updates are included with them most times, and may be needed.