Reaching an optimal trade-off between maximal perceptual quality of reconstructed video and minimal bitrate of the compressed video stream under a maximum bitrate constraint, for a wide variety of content, is a significant challenge and one that has major cost and user-experience implications for video content providers and consumers alike. This challenge is often addressed with content adaptive encoding, and generally strives to reach the optimal bit-rate per content at clip or scene level. Our solution presented herein, goes a step further, and performs encoder adaptation at the frame level. In this paper we describe our closed loop, optimized video encoder which performs encoding to the lowest bitrate which still preserves the perceptual quality of an encode to the target bitrate. The optimization is performed on a frame-by-frame basis, guaranteeing the visual quality of the video, in a manner that minimizes additional encoder complexity, thus making the solution applicable for live or real-time encoding. We also describe our subjectively tuned, low complexity, perceptual video quality metric which is the engine driving this solution.