I'm not sure how to do that in Linux, but I know how to do it with DirectX
. This link is an interesting reading about video inputs using SDL:
http://sdldoc.csn.ul.ie/guidevideo.php
There might be a command to return it with SDL in a for next loop just as it's done with DirectX, but I dunno which :S. Sorry if it was of no help
...