/**

*

*/

//ini_set("max_execution_time", "1800");

class dir{

public $dir;

public $file;

public $dirdir;

public $notex;

public $notdir;

function __construct(){

$this->notex=array("php","js","tgz");//不允许显示的后缀名文件

$this->notdir=array("a","phpmyadmin");//不允许显示的文件夹

if($_GET['video']){

$type=isset($_GET['type'])?$_GET['type']:"webm";

$this->ffmpeg($_GET['video'],$type);

}

if ($_GET['dir']) {

foreach ($this->notdir as $key => $value) {

if(strtolower($_GET['dir'])==$value){

$_GET['dir']=".";

}

}

$tom=trim($_GET['dir']);

$tam=str_replace("..", ".", $tom);

$this->dir="./".$tam;

}else{

$this->dir=".";

}

}

function open_dir(){

if(is_dir($this->dir)){

if($dh=opendir($this->dir)){

while(($file=readdir($dh))!==false){

$this->jugg($file);

}

sort($this->file);

sort($this->dirdir);

closedir($dh);

}

}else{

echo "error";

}

}

function jugg($jugg){

if($jugg!="."&&$jugg!=".."){

if (is_dir($this->dir."/".$jugg)) {

if(!in_array(strtolower($this->filename($jugg)), $this->notdir)){

$this->dirdir[]=$this->dir."/".$jugg;

}

}else{

$ex=array_pop(explode(".", $jugg));

if(!in_array(strtolower($ex), $this->notex)){

$this->file[]=$this->dir."/".$jugg;

}

}

}

}

function dirurl($dir){

$urf=substr($dir,2 );

return "?dir=".$urf;

}

function type($file){

$ex=strtolower(array_pop(explode(".", $file)));

switch ($ex) {

case 'png':

case 'jpg':

case 'gif':

case 'bmp':

case 'jpeg':

return "img";

break;

case 'torrent':

return "torrent";

break;

case 'mp3':

return "mp3";

break;

case 'mp4':

case 'ogg':

case 'webm':

return "video";

break;

case 'xls':

case 'xlsx':

case 'doc':

case 'docx':

case 'ppt':

case 'pptx':

return "other";

break;

case 'pdf':

return "pdf";

break;

case 'txt':

case 'json':

case 'xml':

case 'html':

case 'md':

return "text";

break;

default:

return "other";

break;

}

}

function download($file){

$info=pathinfo($file);

$my_ex=strtolower($info['extension']);

$ex=array("mkv","flv","avi","rm","rmvb","3gp");

if(in_array($my_ex, $ex)){

return "|";

}else{

return "";

}

}

function other($file){

}

function img($img){

}

function pdf($pdf){

}

function video($video){

}

function mp3($mp3){

}

function torrent($torrent){

}

function filename($file){

return array_pop(explode("/", $file));

}

function text($file){

}

function size($file){

$fz=filesize($file);

if ($fz>(1024*1024*1024)) {

return sprintf("%.2f",$fz/(1024*1024*1024))."GB";

}elseif ($fz>(1024*1024)) {

return sprintf("%.2f",$fz/(1024*1024))."MB";

}elseif($fz>1024){

return sprintf("%.2f",$fz/1024)."KB";

}else{

return $fz."B";

}

}

function mtime($file){

return date("Y-m-d H:i:s",filemtime($file));

}

function atime($file){

return date("Y-m-d H:i:s",fileatime($file));

}

function ctime($file){

return date("Y-m-d H:i:s",filectime($file));

}

function ffmpeg($value,$type="webm"){//视频文件

$video=$value.".".$type;

$ecex="ffmpeg -i ".$value." " .$video;

exec($ecex);

}

function icon($file){

$ex=strtolower(array_pop(explode(".", $file)));

switch ($ex) {

case 'png':

case 'jpg':

case 'gif':

case 'bmp':

case 'jpeg':

return "glyphicon glyphicon-picture";

break;

case 'torrent':

return "glyphicon glyphicon-magnet";

break;

case 'mp3':

return "glyphicon glyphicon-music";

break;

case 'mp4':

case 'ogg':

case 'webm':

return "glyphicon glyphicon-film";

break;

case 'xls':

case 'xlsx':

case 'doc':

case 'docx':

case 'ppt':

case 'pptx':

return "glyphicon glyphicon-pencil";

break;

case 'pdf':

return "glyphicon glyphicon-book";

break;

case 'txt':

case 'md':

return "glyphicon glyphicon-file";

break;

default:

return "glyphicon glyphicon-stop";

break;

}

}

function pre(){

$dir_array=explode("/", $this->dir);

$num=count($dir_array);

if($num>=2){

@array_shift($dir_array);

$url="/.";

foreach ($dir_array as $key => $value) {

$step=$step.$value."/";

$url=$url."/".$value."";

}

return $url;

}

}

}

$x=new dir();

$x->open_dir();

?>

Vardir

body{

background-color:#F1F1FA;

}

.container{

margin-top: 100px;

border-radius:15px;

background-color:#FFFFFF;

}

>

echo $x->pre();

?>

文件名 大小 时间 下载

foreach ($x->dirdir as $key => $value) {

echo "

";

echo "

dirurl($value)."\"> ".$x->filename($value)."";

echo "

目录";

echo "

".$x->mtime($value)."";

echo "

";

echo "

";

}

foreach ($x->file as $key => $value) {

echo "

";

echo "

icon($value)." fileshow\" type=\"".$x->type($value)."\" value=\"".rawurlencode($value)."\"> ".$x->filename($value)."";

echo "

".$x->size($value)."";

echo "

".$x->mtime($value)."";

echo "

".$x->download($value)."";

echo "

";

}

?>

Powered by webdir

Close

$(".fileshow").click(function(){

var type=$(this).attr("type");

var name=$(this).text();

var value=$(this).attr("value");

switch(type){

case "img":

$(".modal-title").html("");

$(".modal-title").html(name);

$(".modal-body").html("");

$(".modal-body").html("");

$("#modal").modal();

break;

case "video":

$(".modal-title").html("");

$(".modal-title").html(name);

$(".modal-body").html("");

$(".modal-body").html("");

$("#modal").modal();

break;

case "mp3":

$(".modal-title").html("");

$(".modal-title").html(name);

$(".modal-body").html("");

$(".modal-body").html("您的浏览器不支持 audio 标签。");

$("#modal").modal();

break;

case "text":

$(".modal-title").html("");

$(".modal-title").html(name);

$(".modal-body").html("");

$(".modal-body").html("");

$("#modal").modal();

break;

case "pdf":

$(".modal-title").html("");

$(".modal-title").html(name);

$(".modal-body").html("");

$(".modal-body").html("");

$("#modal").modal();

default:

}

})

$('#modal').on('hidden.bs.modal', function (e) {

var play=$("#play")[0];

play.pause();

})

$(".click_onload").mouseover(function(){

$(this).addClass("text-primary");

})

$(".click_onload").mouseout(function(){

$(this).removeClass("text-primary");

})

$(".ffmpeg").click(function(){

var value=$(this).attr("value");

$.get(value);

})

一键复制

编辑

Web IDE

原始数据

按行查看

历史

php+date+timezoe,ffmpeg.php相关推荐

  1. php+date+timezoe,PHP 字符串

    # PHP 字符串 > 原文: [https://zetcode.com/lang/php/strings/](https://zetcode.com/lang/php/strings/) 在 ...

  2. java FFMPEG调取usb摄像头,截取视频,添加文字和时间水印

    最近工作中接触到了视频监控这块东西,最开始使用的是海康摄像头,因为有文档还有技术对接,做起来基本还算顺利,但是后来需求要求支持usb摄像头,最开始百度了一圈,用啥opencv  javacv之类的技术 ...

  3. 开源项目:windows下使用MinGW+msys编译ffmpeg

    本文参考了网络上的不少文章,但由于版本环境的问题参考文章并不能直接指导编译,本文吸收多方经验,并在自己多次编译实验的基础上写成,欢迎转载,请注名出处.     FFmpeg是在Linux平台下开发的, ...

  4. ffmpeg php 抠像_PHP中使用ffmpeg截取视频图片笔记

    网上很多介绍的文章乱七八糟,说什么装扩展,还得编译... 等等都是些垃圾. 实现截取视频的封面图片简单的很,只需要3步: 1. 安装ffmpeg软件(什么系统都有对应的安装包),2.PHP中compo ...

  5. windows msys编译64位x264和ffmpeg

    1. 安装msys msys(Minimal GNU system on Windows),是一个小型的GNU环境,包括基本的bash,make等等.与Cygwin差不多吧, 我也没用过cygwin ...

  6. 使用FFmpeg进行视频抽取音频,之后进行语音识别转为文字

    1.首先需要下载FFmpeg: 2.Gradle依赖 def void forceVersion(details, group, version) {if (details.requested.gro ...

  7. FFmpeg音频编码 ---- pcm转aac(使用新版ffmpeg API,亲测可用)

    /** * @projectName 08-01-encode_audio * @brief 音频编码 * 从本地读取PCM数据进行AAC编码 * 1. 输入PCM格式问题,通过AVCodec的sam ...

  8. windows下使用MinGW+msys编译ffmpeg

    本文参考了网络上的不少文章,但由于版本环境的问题参考文章并不能直接指导编译,本文吸收多方经验,并在自己多次编译实验的基础上写成,欢迎转载,请注名出处.     FFmpeg是在Linux平台下开发的, ...

  9. avi和音频合成 ffmpeg_使用Java和ffmpeg把音频和视频合成视频的操作方法

    FFmpeg是一个开源免费跨平台的视频和音频流方案,属于自由软件,采用LGPL或GPL许可证(依据你选择的组件).它提供了录制.转换以及流化音视频的完整解决方案.它包含了非常先进的音频/视频编解码库l ...

  10. 用Java和ffmpeg把音频和视频合成视频

    借助第三方工具ffmpeg合成视频 需求:在小破站上下载了一些视频,但是放到电脑里面看,我擦,声音文件和视频文件是分开的. 正确安装ffmpeg并配置好环境变量. Java代码测试 转载指明源头 里面 ...

最新文章

  1. python与excel的关系-使用python对excle和json互相转换的示例
  2. 用CURD来拯救前端的一切的一切
  3. 职业:图像处理入门教程
  4. 『C#基础』调用CMD的一个小工具
  5. 数据处理工具(一)——Matplotlib
  6. 工作152:阅读之后台管理登录样式
  7. spring mvc学习(45):springMVC的三大组件
  8. python类属性和实例属性_Python 类属性与实例属性,类对象与实例对象用法分析...
  9. go 跨平台编译linux,golang 跨平台编译
  10. Extjs 4 MVC中全局配置文件
  11. [转载]Qt之模型/视图(实时更新数据)
  12. 前端文档汇总(觉得对您有用的话,别忘了给点个赞哦 ^_^ !) 1
  13. APISpace 成语大全API接口 免费好用
  14. 【开源项目】CircuitJS1在线电路仿真
  15. 8类网线利弊_超6类7类8类网线进来挨打 6类线全面测评 网速和传输速率测试
  16. 用友U8案例教程销售管理后台配置
  17. 2019-01-21-mqtt-mosquitto-启动Unable to load CA certificates
  18. IPsec-Tools配置之racoon
  19. 帝国 php 7.0 默认 后台用户名及认证码,帝国CMS忘记后台登陆用户名 密码 认证码 安全提问答案 数据库用户名及密码的解决方法 | 坐倚北风...
  20. 计算机中汉字的顺序用什么牌,中国汉字的写做顺序,你知道吗?

热门文章

  1. 如何保证战略落地_如何真正让企业战略规划体系落地
  2. 2020年Vault咨询公司排名TOP 50
  3. 微生物组-扩增子16S分析第10期(报名直播课免费参加线下2020.10)
  4. Leetcode0720. 词典中最长的单词(simple)
  5. zt 李鸿章听过《彩云追月》?
  6. React Native 程序部署至 iOS 应用商店之前需要的配置和如何生成 release 版本的 APK 包
  7. 移动开发即服务,腾讯云移动开发平台打造开发新模式
  8. 内核抢占PREEMPT_RT
  9. 【滴滴拉屎】一款能按照坑型找厕所的神器!
  10. 欢迎来到咆哮2020:人工智能时代