How to retrieve Video Clips programmatically ?

I have a list of 500 time slots in the form {start_time:xx,end_time:xx}.

I want to retrieve recorded video from one camera between those time slots through Milestone.

Each video will be roughly 20 seconds to a minute long.

I know I could retrieve these video clips using the Smart Client, however it would be quite time consuming.

What options do I have to retrieve these video clips programatically ?

Please explore the Export sample.

http://doc.developer.milestonesys.com/html/index.html?base=samples/export_sample.html&tree=tree_2.html