Why can't the king castle in this position? In a video I'm watching (requires register), it has this setup.
[FEN &quot;r3k2r/pp1qn1pp/2p2p2/8/3P4/5N2/PP2QPPP/2R1R1K1 b kq - 0 1&quot;]
[startflipped &quot;&quot;]

The instructor says:

The king cannot escape, he cannot castle kingside or queenside,
because of the white's pressure on e7 [...]. Black wants to escape
this pressure by castling by hand.

I don't understand why can't black castle. It won't castle from, through, or into check. Why is it?
Executive summary:

Black actually can castle, but if he does castle he will lose the knight and the game (due to material loss).

Detailed answer:

Black and White have equal material.


The black knight is protected by two pieces: the king and the queen.
The black knight is attacked  by two pieces: the queen and rook.


If the king castles, the knight will be protected only by the queen, and White will be able to win the knight which will lead to a big material advantage: a knight, which is worth about 3 points.

"Castle by hand" (meaning moving the king and the rook over several turns until they reach a castle position) will allow Black to keep protecting the knight. (E.g. By moving the king to F7 to protect the knight, followed by a rook to E8, etc.)