尝试在编码一次后使用PHP FFMpeg打开文件

尝试在编码一次后使用PHP FFMpeg打开文件,php,ffmpeg,ffmpeg-php,Php,Ffmpeg,Ffmpeg Php,在同一个PHP过程中,我试图打开一个被操纵和保存的文件,然后我试图将其作为新的FFMpeg\Video打开。例如,在同一过程中: Open -> original.MOV Manipulate & save to -> new.mp4 Open -> new.mp4 但是,当我试图打开被操纵的文件时,我得到以下InvalidArgumentException异常: InvalidArgumentException: Unable to detect fil

在同一个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函数打开($pathfile)
{
如果(null==$streams=$this->ffprobe->streams($pathfile)){
抛出新的RuntimeException(sprintf('无法探测“%s.”,$pathfile));
}
如果(0videos()){
返回新视频($pathfile、$this->driver、$this->ffprobe);
}elseif(0audios()){
返回新音频($pathfile、$this->driver、$this->ffprobe);
}
抛出新的InvalidArgumentException(“无法检测文件格式,仅支持音频和视频”);
}
我应用于视频的过滤器是音频静音和加速(setpts)


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

显然,我试图打开一个已损坏或不完整的视频文件。不管怎么说,问题不在于代码或上帝禁止的php ffmpeg 显然,我试图打开一个损坏或不完整的视频文件。不管怎么说,问题不在于代码或上帝禁止的php ffmpeg。什么ffmpeg命令应用于MOV?基本上,如果我必须将其转换为ffmpeg,它可能是:ffmpeg-I tests/clips/originals/clip1.MOV-vf'setpts=(1/5)*PTS'-an tests/clips/video_1.mp4看起来不错。您需要读入FFmpeg报告的实际错误,发送给stderr。我使用Monolog进行日志记录,只看到ffprobe命令的日志,没有FFmpeg:,因为您使用ffprobe进行探测,这些日志说明了什么?什么ffmpeg命令应用于MOV?基本上,如果我必须将其转换为ffmpeg,它可能是:ffmpeg-I tests/clips/originals/clip1.MOV-vf'setpts=(1/5)*PTS'-an tests/clips/video_1.mp4看起来不错。您需要读入FFmpeg报告的实际错误,发送给stderr。好吧,我使用Monolog进行日志记录,我只看到ffprobe命令的日志,没有FFmpeg:/因为您使用ffprobe进行探测,这些日志会说什么?
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');
}