<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>

CC BY-SA 4.0
2021-02-11T08:51:37.773Z
2021-02-11T08:51:37.773Z
Zimba
<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>

CC BY-SA 3.0
2017-06-07T12:38:47.327Z
More direct is `ffprobe input -show_entries format=nb_streams -v 0 -of compact=p=0:nk=1`
Gyan
CC BY-SA 3.0
2017-06-07T12:58:20.337Z
Thanks, post updated, I sometimes forget that there's a format class as well.
slhck
CC BY-SA 4.0
2019-09-09T08:25:29.593Z
`ffprobe.exe -i "vid.mkv" -show_entries format` gets the job done, I don't know about all those options you listed.
Shayan
CC BY-SA 4.0
2019-09-09T09:13:21.853Z
@Shayan The options I've used ensure that you'll only get one number as output. Your command shows everything.
slhck
CC BY-SA 4.0
2022-12-26T23:09:56.647Z
For a "smaller" command, we could use another writer: `-of csv=p=0` instead of `-of compact=p=0:nk=1`
TheBigBadBoy
CC BY-SA 3.0
2017-06-07T11:49:52.703Z
2017-06-07T12:56:54.540Z
2017-06-07T12:56:54.540Z
slhck
<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>

<ffmpeg><osx>
How to show number of available streams using ffmpeg?
mrjayviper
# 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  -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 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  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


---

