src/Detectives/ffmpegDetective.php
private function ffprobe($binary = null)
	{
		if (is_null($binary))
		{
			$binary = static::$ffprobe;
		}

		if (!isset($this->metadata))
		{
			$cmd   = "{$binary} -v quiet -print_format json -show_format -show_streams {$this->file}";

			exec($cmd, $output, $returnvalue);

			$json = json_decode( implode("\n", $output), true );

			if (!is_array($json))
			{
				$json = false;
			}

			$this->metadata = $json;

			if ($this->ffprobeHasFormat())
			{
				$this->formats = array_filter(explode(",", $json['format']['format_name']));
			}
		}
	}
private function ffprobe($binary = null)
	{
		if (is_null($binary))
		{
			$binary = static::$ffprobe;
		}

		if (!isset($this->metadata))
		{
			$cmd   = "{$binary} -v quiet -print_format json -show_format -show_streams {$this->file}";

			exec($cmd, $output, $returnvalue);

			$json = json_decode( implode("\n", $output), true );

			if (!is_array($json))
			{
				$json = false;
			}

			$this->metadata = $json;

			if ($this->ffprobeHasFormat())
			{
				$this->formats = array_filter(explode(",", $json['format']['format_name']));
			}
		}
	}
private function ffprobe ( $ binary = null ) { if ( is_null ( $ binary ) ) { $ binary = static :: $ ffprobe ; } if ( ! isset ( $ this -> metadata ) ) { $ cmd = "{$binary} -v quiet -print_format json -show_format -show_streams {$this->file}" ; exec ( $ cmd , $ output , $ returnvalue ) ; $ json = json_decode ( implode ( "\n" , $ output ) , true ) ; if ( ! is_array ( $ json ) ) { $ json = false ; } $ this -> metadata = $ json ; if ( $ this -> ffprobeHasFormat ( ) ) { $ this -> formats = array_filter ( explode ( "," , $ json [ 'format' ] [ 'format_name' ] ) ) ; } } }
Runs an ffprobe on the file or returns cached information.

@return array|false
Runs an ffprobe on the file or returns cached information .