1

We're working on a debian machine and testing avconv. Is it possible to get the duration of the encoding process before we start encoding? The aim of this is to get the total duration and display a progress bar (PHP). Thanks

4

1 回答 1

0

您需要使用 ffprobe 以当前形式计算文件的持续时间,然后才能在开始之前确定最终文件的大小。

Duration:如果是音频和视频尚未混合,如果视频文件 Duration 显示“N/A”,您可以对音频文件使用 ffprobe。

文件大小:您可以使用 avconv 选项控制输出文件的大小,例如视频比特率、音频比特率,以及 ffprobe 检测到的要编码的视频的长度/持续时间。

以下是使用典型 avconv 选项设置计算 30 分钟视频文件大小的示例:

http://ffmpeg.org/pipermail/ffmpeg-user/2012-February/005194.html

使用 PHP(或者更好的是,对 PHP 后端的 ajax 调用并使用 javascript 或 jquery 进行动画处理)随着文件输出的大小向最终大小增长而更新进度条。

于 2013-10-25T18:36:01.357 回答