企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
获取音频时长信息 ~~~ /** * 获取音频时长信息 * @param string $video_file * @param boolean $org * @param boolean $local * @return array */ public static function get_audio_info($video_file, $org = true, $local = true) { $ffprobe = shell_exec("ffprobe -v quiet -print_format json -show_format -show_streams " . $video_file); $ffprobe = json_decode($ffprobe, true); $param = array( 'duration' => 0, ); if (isset($ffprobe['format']['duration'])) { if ($org === true) { $param['duration'] = $ffprobe['format']['duration']; } else { $param['duration'] = ceil($ffprobe['format']['duration']); } /* 原时长 */ } /* isset */ return $param; } ~~~