Answers.Body: <p>First, if you just want information about a file, you should probably use &quot;ffprobe&quot;, not &quot;ffmpeg&quot;. Otherwise you'll get an answer, but you'll also have an error return status.</p>
  <p>As to your real question: By convention, ffmpeg reserves STDOUT for binary video and audio data <em>only</em>. Everything else, including all the possible kinds of informative text, is sent to STDERR.</p>
  <p>So, try changing your code to:</p>
  <p><code>ffprobe FILENAME.EXT 2| find &quot;Duration:&quot;</code>  (for a *nix shell)</p>
  <p>or</p>
  <p><code>ffprobe.exe FILENAME.EXT 2&gt;&amp;1 | findstr Duration</code> (for a Windows shell)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-18T09:31:44.373Z
Answers.Text: Does not work. See revised question.
Answers.UserDisplayName: K7AAY
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-08-28T19:15:40.283Z
Answers.Text: Improved it. Thank you
Answers.UserDisplayName: garryw
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-07-22T07:00:04.890Z
Answers.LastActivityDate: 2020-08-28T19:01:04.680Z
Answers.LastEditDate: 2020-08-28T19:01:04.680Z
Answers.UserDisplayName: garryw
Body: <p>I want to find video file duration only with <a href="https://ffmpeg.org/ffprobe.html" rel="nofollow noreferrer">ffprobe</a> but</p>
  <pre><code>ffprobe FILENAME.EXT 2| find &quot;Duration:&quot; 
  </code></pre>
  <p>does not filter output to show just the line with <strong>&quot;Duration:&quot;</strong>  Instead, I got:</p>
  <blockquote>
  <p>Argument '2' provided as input filename, but 'FILENAME.MP4' was
  already specified.</p>
  </blockquote>
  <p>How do I see just the duration of a file from the Windows command prompt?</p>
  
Tags: <ffmpeg><windows><script><command-line><ffprobe>
Title: Find duration only with ffprobe in Windows
UserDisplayName: K7AAY
ThreadText: # Find duration only with ffprobe in Windows
  
  (Asked by: username_0 on 2020-07-22)
  
  I want to find video file duration only with [ffprobe](https://ffmpeg.org/ffprobe.html) but
  
  ```
  ffprobe FILENAME.EXT 2| find "Duration:" 
  
  ```
  
  does not filter output to show just the line with **"Duration:"** Instead, I got:
  
  > Argument '2' provided as input filename, but 'FILENAME.MP4' was
  > already specified.
  
  How do I see just the duration of a file from the Windows command prompt?
  
  **Tags:** ffmpeg, windows, script, command-line, ffprobe
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2020-07-22. Score: 2
  
  First, if you just want information about a file, you should probably use "ffprobe", not "ffmpeg". Otherwise you'll get an answer, but you'll also have an error return status.
  
  As to your real question: By convention, ffmpeg reserves STDOUT for binary video and audio data *only*. Everything else, including all the possible kinds of informative text, is sent to STDERR.
  
  So, try changing your code to:
  
  `ffprobe FILENAME.EXT 2| find "Duration:"` (for a \*nix shell)
  
  or
  
  `ffprobe.exe FILENAME.EXT 2>&1 | findstr Duration` (for a Windows shell)
  
  > **Comments:**
  > **username_0**: Does not work. See revised question.  
  > **username_1**: Improved it. Thank you  
  
  ---
  
  