<p>The command will show entries for those English tracks which have been assigned a language tag of <code>eng</code>:</p>

<pre><code>ffprobe -show_entries stream=index,codec_type:stream_tags=language -of compact video.mp4 -v 0 | grep eng
</code></pre>

<p>Output e.g.</p>

<pre><code>stream|index=1|codec_type=audio|tag:language=eng
</code></pre>

<p>(On Windows, use <code>findstr eng</code> in place of <code>grep eng</code>)</p>

CC BY-SA 3.0
2016-10-22T17:45:56.390Z
finally! thanks--I've been asking all over and you're the first one to answer with something I could actually use..:)
armight29
CC BY-SA 3.0
2016-10-22T12:58:26.883Z
2016-10-22T12:58:26.883Z
Gyan
<p>With ffmpeg, you'll get a list of streams, showing any tracks that have been tagged with a language type like so:</p>
<pre><code>ffmpeg.exe -i %a% 2&gt;&amp;1 | find &quot;Stream&quot;
</code></pre>
<p>Output (showing list of audio, video &amp; subtitle tracks with any language tags):</p>
<pre><code>Stream #0:0[0x83e]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x83f]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream #0:2[0x841]: Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 384 kb/s (default)
Stream #0:3[0x840]: Audio: mp3 ([4][0][0][0] / 0x0004), 0 channels
Stream #0:4[0x842]: Audio: mp3 ([4][0][0][0] / 0x0004), 0 channels
Stream #0:5[0x853](tai): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:6[0x854](may): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:7[0x855](vie): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:8[0x856](tha): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:9[0x857](ind): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:10[0x858](bur): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
</code></pre>

CC BY-SA 4.0
2021-02-11T07:49:25.727Z
2021-02-11T07:49:25.727Z
Zimba
<p>I know this is a bit old, but I was looking for the same thing and I found a better way.</p>

<p>So first the code for ffprobe</p>

<pre><code>ffprobe -v error -show_entries stream=index,codec_name,codec_type:stream_tags=language -of default=noprint_wrappers=1 "location\input.avi"
</code></pre>

<p>The results will show only what you're looking for and nothing more, were as with Mulvya results will include more than what you need, so now all you have to do is split the results.</p>

<p>This is how I would do this in batch</p>

<pre><code>For /F "tokens=1* delims=^=" %%a in ('ffprobe -v error -show_entries stream^="index,codec_name,codec_type:stream_tags^=language" -of default^=noprint_wrappers^=1 "location\input.avi"') do (
        Echo. %%a %%b
)
Results:
index 0
codec_type video
codec_name h264
TAG:language und
index 1
codec_type audio
codec_name aac
TAG:language eng
</code></pre>

<p>This is how I'd do it in bash, although I'm still learning, so there could be a better way to script this.</p>

<pre><code>for i in $(echo $(ffprobe -v error -show_entries stream=index,codec_name,codec_type:stream_tags=language -of default=noprint_wrappers=1 "location/input.avi") | tr " " "\n") ; do
   echo $(echo $i | cut -d \= -sf 1)  $(echo $i | cut -d \= -sf 2) 
done
Results:
index 0
codec_type video
codec_name h264
TAG:language und
index 1
codec_type audio
codec_name aac
TAG:language eng
</code></pre>

<p>One major difference with the results using ffprobe on windows and Linux, is that with Linux the results show up on a single line, with windows each result appears on a new line, so, with windows we can get away with simply splitting the results, using the delimiter "=", but with bash we need to first split the space, then split by "=".</p>

<p>Now that we've got our results, with either version, you can simply do an if statement to determine the language, although I would suggest doing an if statement to first find "TAG:language" then a nested statement to check what language, I consider this more of a fail-safe, although I doubt there's a codec type/name called eng.</p>

CC BY-SA 3.0
2017-01-05T17:08:12.813Z
*were as  with Mulvya results will include more than what you need* --> my command shows fewer fields than yours, as shown in the Output sample.
Gyan
CC BY-SA 3.0
2017-01-12T02:02:22.647Z
What you're referring to are the filtered results from the loop, which for mines includes codec_name and shows both streams, if OP doesn't want that, then it can be changed quite easily. But regardless, that's not what I meant regarding the unnecessary data, if I was to run both ffprobe commands, yours would output more data, whereas mines only displays the data I specified in my command, here's an image of the [results](http://prnt.sc/duirf2), in fact, we can output only your results the same way by using "-v error -show_entries stream=index,codec_type:stream_tags=language -of compact f.mp4".
Rycore
CC BY-SA 3.0
2017-01-12T05:19:39.013Z
Looks like you missed the -v 0 and grep in my command.
Gyan
CC BY-SA 3.0
2017-01-05T01:18:07.567Z
2017-01-12T01:30:43.953Z
2017-01-12T01:30:43.953Z
Rycore
<p>as the title suggests I need command for ffmpeg or ffprobe to list only english sub and audio tracks in a media file;I suspect this may involve using sed, awk, or exiftool--if anyone can explain I would appreciate it. TIA</p>

<ffmpeg>
Use ffprobe or ffmpeg to list ony english tracks
armight29
# Use ffprobe or ffmpeg to list ony english tracks

(Asked by: username_0 on 2016-10-22)

as the title suggests I need command for ffmpeg or ffprobe to list only english sub and audio tracks in a media file;I suspect this may involve using sed, awk, or exiftool--if anyone can explain I would appreciate it. TIA

**Tags:** ffmpeg


---

## 3 answers

### Answer by username_1 on 2016-10-22. Score: 2

The command will show entries for those English tracks which have been assigned a language tag of eng:
ffprobe -show_entries stream=index,codec_type:stream_tags=language -of compact video.mp4 -v 0 | grep eng

Output e.g.
stream|index=1|codec_type=audio|tag:language=eng

(On Windows, use findstr eng in place of grep eng)

> **Comments:**
> **username_0**: finally! thanks--I've been asking all over and you're the first one to answer with something I could actually use..:)  

---

### Answer by username_2 on 2021-02-11. Score: 0

With ffmpeg, you'll get a list of streams, showing any tracks that have been tagged with a language type like so:
ffmpeg.exe -i %a% 2>&1 | find "Stream"

Output (showing list of audio, video & subtitle tracks with any language tags):
Stream #0:0[0x83e]: Video: h264 (High) ([27][0][0][0] / 0x001B), yuv420p(top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
Stream #0:1[0x83f]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream #0:2[0x841]: Audio: aac (mp4a / 0x6134706D), 48000 Hz, 5.1, fltp, 384 kb/s (default)
Stream #0:3[0x840]: Audio: mp3 ([4][0][0][0] / 0x0004), 0 channels
Stream #0:4[0x842]: Audio: mp3 ([4][0][0][0] / 0x0004), 0 channels
Stream #0:5[0x853](tai): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:6[0x854](may): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:7[0x855](vie): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:8[0x856](tha): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:9[0x857](ind): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream #0:10[0x858](bur): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)


---

### Answer by username_3 on 2017-01-05. Score: 0

I know this is a bit old, but I was looking for the same thing and I found a better way.
So first the code for ffprobe
ffprobe -v error -show_entries stream=index,codec_name,codec_type:stream_tags=language -of default=noprint_wrappers=1 "location\input.avi"

The results will show only what you're looking for and nothing more, were as with Mulvya results will include more than what you need, so now all you have to do is split the results.
This is how I would do this in batch
For /F "tokens=1* delims=^=" %%a in ('ffprobe -v error -show_entries stream^="index,codec_name,codec_type:stream_tags^=language" -of default^=noprint_wrappers^=1 "location\input.avi"') do (
        Echo. %%a %%b
)
Results:
index 0
codec_type video
codec_name h264
TAG:language und
index 1
codec_type audio
codec_name aac
TAG:language eng

This is how I'd do it in bash, although I'm still learning, so there could be a better way to script this.
for i in $(echo $(ffprobe -v error -show_entries stream=index,codec_name,codec_type:stream_tags=language -of default=noprint_wrappers=1 "location/input.avi") | tr " " "\n") ; do
   echo $(echo $i | cut -d \= -sf 1)  $(echo $i | cut -d \= -sf 2) 
done
Results:
index 0
codec_type video
codec_name h264
TAG:language und
index 1
codec_type audio
codec_name aac
TAG:language eng

One major difference with the results using ffprobe on windows and Linux, is that with Linux the results show up on a single line, with windows each result appears on a new line, so, with windows we can get away with simply splitting the results, using the delimiter "=", but with bash we need to first split the space, then split by "=".
Now that we've got our results, with either version, you can simply do an if statement to determine the language, although I would suggest doing an if statement to first find "TAG:language" then a nested statement to check what language, I consider this more of a fail-safe, although I doubt there's a codec type/name called eng.

> **Comments:**
> **username_1**: *were as  with Mulvya results will include more than what you need* --> my command shows fewer fields than yours, as shown in the Output sample.  
> **username_3**: What you're referring to are the filtered results from the loop, which for mines includes codec_name and shows both streams, if OP doesn't want that, then it can be changed quite easily. But regardless, that's not what I meant regarding the unnecessary data, if I was to run both ffprobe commands, yours would output more data, whereas mines only displays the data I specified in my command, here's an image of the [results](http://prnt.sc/duirf2), in fact, we can output only your results the same way by using "-v error -show_entries stream=index,codec_type:stream_tags=language -of compact f.mp4".  
> **username_1**: Looks like you missed the -v 0 and grep in my command.  

---

