private function getRemuxStream(Request $request, Response $response)
    {
        if (!$this->config->remux) {
            throw new Exception(_('You need to enable remux mode to merge two formats.'));
        }
        $stream = $this->video->getRemuxStream();
        $response = $response->withHeader('Content-Type', 'video/x-matroska');
        if ($request->isGet()) {
            $response = $response->withBody(new Stream($stream));
        }

        return $response->withHeader(
            'Content-Disposition',
            'attachment; filename="'.$this->video->getFileNameWithExtension('mkv')
        );
    }