private function getConvertedResponse(Request $request, Response $response)
    {
        $response = $response->withHeader(
            'Content-Disposition',
            'attachment; filename="'.
            $this->video->getFileNameWithExtension($request->getQueryParam('customFormat')).'"'
        );
        $response = $response->withHeader('Content-Type', 'video/'.$request->getQueryParam('customFormat'));

        if ($request->isGet() || $request->isPost()) {
            $process = $this->video->getConvertedStream(
                $request->getQueryParam('customBitrate'),
                $request->getQueryParam('customFormat')
            );
            $response = $response->withBody(new Stream($process));
        }

        return $response;
    }