Using the system command
===

I am using the following system command to call ffmpeg im my c program:
    
    system("ffmpeg -t 10 -f video4linux2 -s 640x480 -r 30 -i /dev/video0 -f mp4 /home/somepath/webcam.mp4");
    system("ffmpeg -i /home/somepath/webcam.mp4 -r 1 -s 640x480 -f image2 foo-%03d.jpeg");


The problem is I need to call the second system only after the first one is completed after 10 seconds. The only way I can think of doing this is using a thread.sleep() and then call it. Is there any other more elegant method of achieving the same?