1

在同一个 PHP 进程中,我试图打开一个被操作和保存的文件,然后我试图将其作为新的 FFMpeg\Video 打开。例如,在同一过程中:

Open -> original.MOV
  Manipulate & save to -> new.mp4
    Open -> new.mp4

然而,当我试图打开被操纵的文件时,我得到了这个 InvalidArgumentException 异常:

InvalidArgumentException: Unable to detect file format, only audio and video supported

在 FFMpeg::open() 无法检测到它是视频流还是音频流后,它会抛出它。

FFMpeg::open()

public function open($pathfile)
{
    if (null === $streams = $this->ffprobe->streams($pathfile)) {
        throw new RuntimeException(sprintf('Unable to probe "%s".', $pathfile));
    }

    if (0 < count($streams->videos())) {
        return new Video($pathfile, $this->driver, $this->ffprobe);
    } elseif (0 < count($streams->audios())) {
        return new Audio($pathfile, $this->driver, $this->ffprobe);
    }

    throw new InvalidArgumentException('Unable to detect file format, only audio and video supported');
}

我应用于视频的过滤器是音频静音和加速(setpts)。

所以我想知道,为什么 FFMpeg 不将其识别为视频?

4

1 回答 1

0

显然我试图打开一个损坏或不完整的视频文件。无论如何,问题不在于代码或上帝禁止 - php-ffmpeg。

于 2016-05-19T16:59:21.443 回答