Answers.Body: <p>To count &quot;<em>number of available streams using ffmpeg'</em>&quot;:</p>
  <pre><code>ffmpeg.exe -i %input% 2&gt;&amp;1 | find /c &quot;Stream&quot;
  </code></pre>
  <p>Tested in Win 10 CMD</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-11T08:51:37.773Z
Answers.LastActivityDate: 2021-02-11T08:51:37.773Z
Answers.UserDisplayName: Zimba
Answers.Body: <p>If you have <code>ffprobe</code> installed:</p>
  
  <pre><code>ffprobe &lt;input&gt; -show_entries format=nb_streams -v 0 -of compact=p=0:nk=1
  </code></pre>
  
  <p>You can also filter for video or audio streams by adding <code>-select_streams v</code> or <code>-select_streams a</code>, respectively. See <a href="https://ffmpeg.org/ffprobe.html" rel="noreferrer">the manual</a> for more details.</p>
  
  <p>If you do not have <code>ffprobe</code>, <code>ffmpeg</code> can be used too, but in a slightly less robust way (i.e., this may break if the output format changes or something contains the words "Stream #" in the output):</p>
  
  <pre><code>ffmpeg -i &lt;input&gt; 2&gt;&amp;1 | grep "Stream #" | wc -l
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-07T12:38:47.327Z
Answers.Text: More direct is `ffprobe input -show_entries format=nb_streams -v 0 -of compact=p=0:nk=1`
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-07T12:58:20.337Z
Answers.Text: Thanks, post updated, I sometimes forget that there's a format class as well.
Answers.UserDisplayName: slhck
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-09T08:25:29.593Z
Answers.Text: `ffprobe.exe -i "vid.mkv" -show_entries format` gets the job done, I don't know about all those options you listed.
Answers.UserDisplayName: Shayan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-09-09T09:13:21.853Z
Answers.Text: @Shayan The options I've used ensure that you'll only get one number as output. Your command shows everything.
Answers.UserDisplayName: slhck
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-26T23:09:56.647Z
Answers.Text: For a "smaller" command, we could use another writer: `-of csv=p=0` instead of `-of compact=p=0:nk=1`
Answers.UserDisplayName: TheBigBadBoy
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-07T11:49:52.703Z
Answers.LastActivityDate: 2017-06-07T12:56:54.540Z
Answers.LastEditDate: 2017-06-07T12:56:54.540Z
Answers.UserDisplayName: slhck
Body: <p>I just want to see how many streams are inside my video file.</p>
  
  <p>I looked at the <a href="http://ffmpeg.org/ffmpeg.html" rel="noreferrer">official documentation</a> and I cannot see what option I can use. Perhaps another command/terminal app can do something similar?</p>
  
  <p>Any ideas how it can be done?</p>
  
Tags: <ffmpeg><osx>
Title: How to show number of available streams using ffmpeg?
UserDisplayName: mrjayviper
ThreadText: # How to show number of available streams using ffmpeg?
  
  (Asked by: username_0 on 2017-06-07)
  
  I just want to see how many streams are inside my video file.
  
  I looked at the [official documentation](http://ffmpeg.org/ffmpeg.html) and I cannot see what option I can use. Perhaps another command/terminal app can do something similar?
  
  Any ideas how it can be done?
  
  **Tags:** ffmpeg, osx
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2017-06-07. Score: 15 | Accepted answer
  
  If you have `ffprobe` installed:
  
  ```
  ffprobe <input> -show_entries format=nb_streams -v 0 -of compact=p=0:nk=1
  
  ```
  
  You can also filter for video or audio streams by adding `-select_streams v` or `-select_streams a`, respectively. See [the manual](https://ffmpeg.org/ffprobe.html) for more details.
  
  If you do not have `ffprobe`, `ffmpeg` can be used too, but in a slightly less robust way (i.e., this may break if the output format changes or something contains the words "Stream #" in the output):
  
  ```
  ffmpeg -i <input> 2>&1 | grep "Stream #" | wc -l
  
  ```
  
  > **Comments:**
  > **username_3**: More direct is `ffprobe input -show_entries format=nb_streams -v 0 -of compact=p=0:nk=1`  
  > **username_2**: Thanks, post updated, I sometimes forget that there's a format class as well.  
  > **username_4**: `ffprobe.exe -i "vid.mkv" -show_entries format` gets the job done, I don't know about all those options you listed.  
  > **username_2**: @username_4 The options I've used ensure that you'll only get one number as output. Your command shows everything.  
  > **username_5**: For a "smaller" command, we could use another writer: `-of csv=p=0` instead of `-of compact=p=0:nk=1`  
  
  ---
  
  ### Answer by username_1 on 2021-02-11. Score: 0
  
  To count "*number of available streams using ffmpeg'*":
  
  ```
  ffmpeg.exe -i %input% 2>&1 | find /c "Stream"
  
  ```
  
  Tested in Win 10 CMD
  
  
  ---
  
  