I found that sometimes cvQueryFrame returns null in linux