Code:
function grabScreen($clip, $thumb, $dimensions) {
//$dimensions should be in WxH format
//$thumb should contain the full path to the image you want created
$screengrab = "/usr/local/bin/ffmpeg -y -i '{$clip}' -f mjpeg -ss 10 -vframes 1 -s {$dimensions} -an '{$thumb}'";
@system($screengrab);
}