Question: How can I capture a precise number of frames?
Answer: You can capture a precise number of frames by using the appropriate framework. For example, you can do it with ffmpeg and gstreamer.
https://stackoverflow.com/questions/11557490/ffmpeg-image-capture-continous-frames
http://wiki.oz9aec.net/index.php/Gstreamer_cheat_sheet