编码器 is the standard translation in both hardware contexts (rotary encoder, video encoder) and machine-learning contexts (encoder-decoder, autoencoder). Its mirror term is
解码器 (jiěmǎqì) 'decoder'. Pattern: verb +
器 'machine / device' is highly productive (
放大器 'amplifier',
显示器 'display',
处理器 'processor').