In this paper, a retrieval method is proposed for audio and video fingerprinting systems by adopting a line detection technique. To achieve fast retrieval, the `lines' are generated from sub-fingerprints of query and database, and the non-candidate lines are filtered out. So, the distance between query and refers can be calculated fast. To demonstrate the superiority of this method, the audio fingerprints and video fingerprints are generated for comparisons. The experimental results indicate that the proposed method outperforms the direct hashing method.