Surveillance Video Analysis with External Knowledge and Internal Constraints