Creating a frame grabber for arbitrary camera devices is a tedious and not accomplishable task for one person. Try using existing solutions. I recommend OpenCV.