<p>If you use the <code>-report</code> option, ffmpeg will create a logfile at initialization and the filename will contain the time at which it was created. You can use the last modified time of the log file to get the completion time, and thus the duration. On Windows, you could just check the creation time of the output as well.</p>

<p><strong>Addendum</strong>: A rough way to get this information, universally, without altering the command or using a monitoring tool like <code>time</code>, as LN guided, is to note the encoding speed normally reported i.e. <code>speed=5.50x</code>. So, if the duration of the output file is 110 seconds, then time taken to encode is <strong>110 / 5.5 = 20 seconds</strong>. </p>

CC BY-SA 3.0
2015-12-22T11:56:51.687Z
2015-12-23T07:38:49.470Z
2015-12-23T07:38:49.470Z
Gyan
<p>Use <code>-benchmark</code>.
You will see something like <code>bench: utime=11.969s stime=0.315s rtime=1.908s</code>, the <code>rtime</code> is what you want.</p>

CC BY-SA 4.0
2023-03-08T17:09:37.243Z
How do you use this command? I tired ffmpeg.exe -i input.ts -benchmark output.mp4 AS WELL AS ffmpeg.exe -i input.ts output.mp4 -benchmark, non worked
checho
CC BY-SA 4.0
2020-01-08T07:42:35.910Z
2020-01-08T07:42:35.910Z
Six Edge
<p>In Linux you can use the <code>time</code> command:</p>

<pre><code>$ time ffmpeg -i input.avi output.mp4
  [...]
  real  0m1.927s
  user  0m7.067s
  sys   0m0.243s
</code></pre>

<p>This example took 1.927 seconds to complete.</p>

CC BY-SA 3.0
2017-12-17T00:58:37.920Z
or you can use `ffmpeg -benchmark -i `
Show benchmarking information at the end of an encode. Shows CPU time used and maximum memory consumption. Maximum memory consumption is not supported on all systems, it will usually display as 0 if not supported.
Hany Alsamman
CC BY-SA 3.0
2015-12-22T18:56:22.017Z
2015-12-22T18:56:22.017Z
llogan
<p>Is there a way for <code>FFmpeg</code> to output or log time duration since a particular job/process was started?</p>

<p>I know that there are more or less complicated ways to display a <a href="https://stackoverflow.com/questions/747982/can-ffmpeg-show-a-progress-bar">progress bar</a> which really seems more like a programmatical problem.</p>

<p>The reasoning is that I want to measure how long time my encoding jobs take (without having to set up a separate timer).</p>

<ffmpeg>
Can FFmpeg output time duration since the start of a job?
P A N
# Can FFmpeg output time duration since the start of a job?

(Asked by: username_0 on 2015-12-22)

Is there a way for `FFmpeg` to output or log time duration since a particular job/process was started?

I know that there are more or less complicated ways to display a [progress bar](https://stackoverflow.com/questions/747982/can-ffmpeg-show-a-progress-bar) which really seems more like a programmatical problem.

The reasoning is that I want to measure how long time my encoding jobs take (without having to set up a separate timer).

**Tags:** ffmpeg


---

## 3 answers

### Answer by username_4 on 2015-12-22. Score: 6 | Accepted answer

In Linux you can use the time command:
$ time ffmpeg -i input.avi output.mp4
  [...]
  real  0m1.927s
  user  0m7.067s
  sys   0m0.243s

This example took 1.927 seconds to complete.

> **Comments:**
> **username_5**: or you can use `ffmpeg -benchmark -i ` Show benchmarking information at the end of an encode. Shows CPU time used and maximum memory consumption. Maximum memory consumption is not supported on all systems, it will usually display as 0 if not supported.  

---

### Answer by username_2 on 2020-01-08. Score: 3

Use `-benchmark`.
You will see something like `bench: utime=11.969s stime=0.315s rtime=1.908s`, the `rtime` is what you want.

> **Comments:**
> **username_3**: How do you use this command? I tired ffmpeg.exe -i input.ts -benchmark output.mp4 AS WELL AS ffmpeg.exe -i input.ts output.mp4 -benchmark, non worked  

---

### Answer by username_1 on 2015-12-22. Score: 2

If you use the `-report` option, ffmpeg will create a logfile at initialization and the filename will contain the time at which it was created. You can use the last modified time of the log file to get the completion time, and thus the duration. On Windows, you could just check the creation time of the output as well.

**Addendum**: A rough way to get this information, universally, without altering the command or using a monitoring tool like `time`, as LN guided, is to note the encoding speed normally reported i.e. `speed=5.50x`. So, if the duration of the output file is 110 seconds, then time taken to encode is **110 / 5.5 = 20 seconds**.


---

