A video coding method and apparatus based on intra-frame prediction mode derivation are disclosed. According to the disclosed method, the template region, template features, and method for deriving the directional prediction mode can be adaptively determined for predicting the current block.