Php 如何用毫秒制作'mktime'格式?
我需要用PHPPhp 如何用毫秒制作'mktime'格式?,php,date,ffmpeg,milliseconds,mktime,Php,Date,Ffmpeg,Milliseconds,Mktime,我需要用PHPffmpeg每秒制作24帧。这是当前的格式 $t = mktime(0, 0, 0, 1, 1, 98); 后来我用这个函数 exec("/usr/local/bin/ffmpeg -ss " . date("H:i:s", $t) . " -i {$file} -f mjpeg -vframes 1 -s {$size} {$tmpfile}"); 在date(“H:i:s,$t)中,我需要生成date(“H:i:s.millises,$t)。这是不起作用的date(“H:i
ffmpeg
每秒制作24帧。这是当前的格式
$t = mktime(0, 0, 0, 1, 1, 98);
后来我用这个函数
exec("/usr/local/bin/ffmpeg -ss " . date("H:i:s", $t) . " -i {$file} -f mjpeg -vframes 1 -s {$size} {$tmpfile}");
在date(“H:i:s,$t)
中,我需要生成date(“H:i:s.millises,$t)
。这是不起作用的date(“H:i:s.u”,$t)
因为mktime
格式(小时、分钟、秒、日、月、年)我猜
那么,是否可以将毫秒添加到
mktime
?我认为打印用户定义的“H:I:s.u”时间的最简单解决方案是使用with,它支持微秒:
echo(newdatetime())->setTime(1,2,3456789)->格式('H:i:s.u');
结果:
01:02:03.456789
这意味着您的PHP可以这样编写:
使用microtime()
但是我需要这样的东西`$t=mktime(0,0,0,$microtime\u变量,1,1,98)`