private function getAvconvProcess(
        $audioBitrate,
        $filetype = 'mp3',
        $audioOnly = true,
        $from = null,
        $to = null
    ) {
        if (!$this->checkCommand([$this->config->avconv, '-version'])) {
            throw new Exception(_('Can\'t find avconv or ffmpeg at ').$this->config->avconv.'.');
        }

        $durationRegex = '/(\d+:)?(\d+:)?(\d+)/';

        $afterArguments = [];

        if ($audioOnly) {
            $afterArguments[] = '-vn';
        }

        if (!empty($from)) {
            if (!preg_match($durationRegex, $from)) {
                throw new Exception(_('Invalid start time: ').$from.'.');
            }
            $afterArguments[] = '-ss';
            $afterArguments[] = $from;
        }
        if (!empty($to)) {
            if (!preg_match($durationRegex, $to)) {
                throw new Exception(_('Invalid end time: ').$to.'.');
            }
            $afterArguments[] = '-to';
            $afterArguments[] = $to;
        }

        $urls = $this->getUrl();

        $arguments = array_merge(
            [
                $this->config->avconv,
                '-v', $this->config->avconvVerbosity,
            ],
            $this->getRtmpArguments(),
            [
                '-i', $urls[0],
                '-f', $filetype,
                '-b:a', $audioBitrate.'k',
            ],
            $afterArguments,
            [
                'pipe:1',
            ]
        );

        //Vimeo needs a correct user-agent
        $arguments[] = '-user_agent';
        $arguments[] = $this->getProp('dump-user-agent');

        return new Process($arguments);
    }