public function output($output = null, $forceFormat = null)
{
$this->forceFormat($forceFormat);
$options = array();
foreach ($this->options as $option => $values) {
if (is_array($values)) {
$items = array();
foreach ($values as $item => $val) {
if (!is_null($val)) {
if (is_array($val)) {
print_r($val);
$val = join(',', $val);
}
$val = strval($val);
if (is_numeric($item) and is_integer($item)) {
$items[] = $val;
} else {
$items[] = $item . "=" . $val;
}
} else {
$items[] = $item;
}
}
$options[] = "-" . $option . " " . join(',', $items);
} else {
$options[] = "-" . $option . " " . strval($values);
}
}
$this->command = $this->ffmpeg . " " . join(' ', $options) . " " . $output . $this->STD;
return $this;
}