gpt4 book ai didi

php - 视频持续时间 FFMpeg PHP

转载 作者:行者123 更新时间:2023-12-04 23:16:05 24 4
gpt4 key购买 nike

这可能是一个愚蠢的问题,我试图从使用 FFMpeg 的视频中获取持续时间:Video Duration Time = 1m:47s
我的功能

$ffmpeg = \FFMpeg\FFProbe::create();
$duration = $ffmpeg->format($videos[0]->real_path)->get('duration');

现在如果我打印 $持续时间 : "109.713333"
如何从 $duration 获取视频持续时间??

笔记:

我试过这个
 109.713333 / 60 = 1.82 
82/60 = 1.36 and 82-36 = 46

最佳答案

如果您仍然需要它,请尝试:

$totalSecs = $ffmpeg->format($videos[0]->real_path)->get('duration');
$tempSecs['s'] = $totalSecs;
$duration = gmdate("H:i:s", (int)$tempSecs['s']);

echo "video duration : " . $duration;

PS:
这是哪里 Duration Time = 1m:47s金额从哪里来?
109 秒应该给 1 分钟和 49 秒。想想看。所以这意味着你的反馈之一是错误的......

关于php - 视频持续时间 FFMpeg PHP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38883676/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com