protected function filename($values, $format)
{
$filepath = $values->video;
$audioEncoding = $values->audioEncoding('acc');
$width = $values->width(false);
$height = $values->height(false);
$upscale = $values->upscale(false) ? 'upscale' : false;
$aspectMode = $values->aspectMode('preserve');
$size = "{$width}x{$height}";
$additionalUrl = $audioEncoding;
$additionalUrl .= $width && $height ? "_{$size}" : '';
$additionalUrl .= $upscale ? "_{$upscale}" : '';
$additionalUrl .= $aspectMode ? "_{$aspectMode}" : '';
$info = $this->MediaPaths->isUrlPath($filepath) ? $this->MediaPaths->fileVersionInfoFromUrl($filepath) : $this->MediaPaths->fileVersionInfo($filepath);
return $this->MediaPaths->makeRelativePath("{$info->versiondir}/{$info->filename}_{$additionalUrl}.{$format}");
}