Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-22T17:45:56.390Z
Answers.Text: finally! thanks--I've been asking all over and you're the first one to answer with something I could actually use..:)
Answers.UserDisplayName: armight29
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-10-22T12:58:26.883Z
Answers.LastActivityDate: 2016-10-22T12:58:26.883Z
Answers.UserDisplayName: Gyan
Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-02-11T07:49:25.727Z
Answers.LastActivityDate: 2021-02-11T07:49:25.727Z
Answers.UserDisplayName: Zimba
Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-05T17:08:12.813Z
Answers.Text: *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.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-12T02:02:22.647Z
Answers.Text: 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".
Answers.UserDisplayName: Rycore
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-12T05:19:39.013Z
Answers.Text: Looks like you missed the -v 0 and grep in my command.
Answers.UserDisplayName: Gyan
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-01-05T01:18:07.567Z
Answers.LastActivityDate: 2017-01-12T01:30:43.953Z
Answers.LastEditDate: 2017-01-12T01:30:43.953Z
Answers.UserDisplayName: Rycore
Body: <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>
  
Tags: <ffmpeg>
Title: Use ffprobe or ffmpeg to list ony english tracks
UserDisplayName: armight29
ThreadText: # 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.  
  
  ---
  
  