Knocking combustion is associated with extremely high in-cylinder pressure rise-rates, strong pressure oscillations, destructive engine vibration, as well as audible noise. It not only exists in spark-ignition (SI) engines, but also in compression-ignition (CI) engines, for both conventional Diesel and more premixed modes of combustion. Recent work showed that during Diesel knock the flame’s motion synchronizes with the in-cylinder pressure ringing. To improve the optical method and investigate knock in CI engines further, we imaged the flame luminosity in an optically accessible engine during knock at very high frame rates (60 kHz). First, the knocking time interval was determined based on the temporal variation of the mean image intensity. Within this time interval, the instantaneous flow fields were calculated by “optical flow” based on cross correlation. From these velocity-vector time-series, the oscillation frequencies were obtained and compared to those from pressure-trace analysis and theoretical calculation. The images show a “sloshing” motion of the flame, with nearly the same frequency content as that of pressure ringing. Cavity modes, as predicted by theoretical analysis, can clearly be identified. As opposed to pressure-trace analysis, the optical diagnostic is spatially resolved and shows less cycle-to-cycle variation. Combustion in our CI engine experiments occurred by both sequential auto-ignition and reaction-front propagation. Knock originated from auto-ignition of end gas, resembling knock in SI engines. In one very severe cycle, a shock wave was seen, while the velocity of the gas was found to be always subsonic. From the vector field, the spatial origin of the knock could be estimated. The knock intensity evaluated from optical metrics correlated reasonably well with that from conventional methods based on pressure-trace analysis.