Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-22T11:56:51.687Z
Answers.LastActivityDate: 2015-12-23T07:38:49.470Z
Answers.LastEditDate: 2015-12-23T07:38:49.470Z
Answers.UserDisplayName: Gyan
Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-08T17:09:37.243Z
Answers.Text: 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
Answers.UserDisplayName: checho
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-08T07:42:35.910Z
Answers.LastActivityDate: 2020-01-08T07:42:35.910Z
Answers.UserDisplayName: Six Edge
Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-17T00:58:37.920Z
Answers.Text: 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.
Answers.UserDisplayName: Hany Alsamman
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-12-22T18:56:22.017Z
Answers.LastActivityDate: 2015-12-22T18:56:22.017Z
Answers.UserDisplayName: llogan
Body: <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>
  
Tags: <ffmpeg>
Title: Can FFmpeg output time duration since the start of a job?
UserDisplayName: P A N
ThreadText: # 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**.
  
  
  ---
  
  