在php连接sphinx,从索引文件中找到带关键字记录的id集合,连接数据库后,从数据库中查询id中集合里的记录。使用sphinxapi,从索引文件得到带关键词的id集合,通过$sql1 = "select * from rain_news where id IN ($ids) ";
安装ffmpeg,打开php.ini进行操作,$long = exec("ffmpeg -i video.mp4 2>&1 | grep 'Duration' | cut -d ' ' -f 4 | sed s/,//");//总长度 ,此后重启, 便可以获取视频文件的长度。
网友评论