<p>In some <code>.mkv</code> files with multiple different audio streams I removed all the ones I don't need with ffmpeg and only kept the desired audio stream along with the video and possibly subtitles.
The result works fine in VLC, but in Windows Media Player I don't have any sound after the repacking. I do wonder what the issue is. Anything incorrect with the process? How could I achieve that it still works with WMP after the removal of certain audio streams.
Note: The audio works well in WMP with the original file.</p>

<p>Here's what I use to remove the unneeded streams. Let's say I have a file with three audio streams and I only want to keep the second one:</p>

<pre><code>ffmpeg -i inputfile.mkv -map 0:v -map 0:s -map 0:a:1 -c copy outputfile.mkv
</code></pre>

<p><strong>Edit:</strong>
<code>ffmpgeg -i &lt;file&gt;</code> output before and after removing.</p>

<p>I notice that the encoder changes, maybe that causes issues for WMP?</p>

<pre><code>ffmpeg -i in.mkv

ffmpeg version git-2020-04-17-889ad93 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200328
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 80.100 / 58. 80.100
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, matroska,webm, from 'in.mkv':
  Metadata:
    title           : test
    encoder         : libebml v0.7.7 + libmatroska v0.8.1
    creation_time   : 2011-09-25T09:17:25.000000Z
  Duration: 01:31:44.83, start: 0.000000, bitrate: 13668 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
    Metadata:
      title           : MVO
    Stream #0:2(rus): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : DUB
    Stream #0:3(rus): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : Mihalev
    Stream #0:4(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Metadata:
      title           : DTSHD core5.1 1536k
    Stream #0:5(rus): Subtitle: subrip (default)




ffmpeg -i out.mkv

ffmpeg version git-2020-04-17-889ad93 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200328
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 80.100 / 58. 80.100
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, matroska,webm, from 'out.mkv':
  Metadata:
    title           : test
    ENCODER         : Lavf58.42.100
  Duration: 01:31:44.83, start: 0.000000, bitrate: 12842 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      DURATION        : 01:31:44.828000000
    Stream #0:1(rus): Subtitle: subrip (default)
    Metadata:
      DURATION        : 01:26:07.385000000
    Stream #0:2(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Metadata:
      title           : DTSHD core5.1 1536k
      DURATION        : 01:31:44.273000000

</code></pre>

<p><strong>EDIT 2:</strong>
Log output of <code>ffmpeg -i inputfile.mkv -map 0:v -map 0:s -map 0:a:1 -c copy outputfile.mkv</code></p>

<pre><code>ffmpeg -i inputfile.mkv -map 0:v -map 0:s -map 0:a:1 -c copy out.mkv
ffmpeg version git-2020-04-17-889ad93 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200328
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 80.100 / 58. 80.100
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, matroska,webm, from 'inputfile.mkv':
  Metadata:
    title           : test
    encoder         : libebml v0.7.7 + libmatroska v0.8.1
    creation_time   : 2011-09-25T09:17:25.000000Z
  Duration: 01:31:44.83, start: 0.000000, bitrate: 13668 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
    Metadata:
      title           : MVO
    Stream #0:2(rus): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : DUB
    Stream #0:3(rus): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : Mihalev
    Stream #0:4(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Metadata:
      title           : DTSHD core5.1 1536k
    Stream #0:5(rus): Subtitle: subrip (default)
Output #0, matroska, to 'out.mkv':
  Metadata:
    title           : test
    encoder         : Lavf58.42.100
    Stream #0:0(eng): Video: h264 (High) (H264 / 0x34363248), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
    Stream #0:1(rus): Subtitle: subrip (default)
    Stream #0:2(rus): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : DUB
Stream mapping:
  Stream #0:0 -&gt; #0:0 (copy)
  Stream #0:5 -&gt; #0:1 (copy)
  Stream #0:2 -&gt; #0:2 (copy)
Press [q] to stop, [?] for help
frame=131984 fps=941 q=-1.0 Lsize= 7741970kB time=01:31:44.70 bitrate=11521.5kbits/s speed=39.3x
video:7611378kB audio:128246kB subtitle:66kB other streams:0kB global headers:0kB muxing overhead: 0.029470%
</code></pre>

CC BY-SA 4.0
2020-04-23T06:33:07.547Z
Share the full log of `ffmpeg -i file` for both input and output.
Gyan
CC BY-SA 4.0
2020-04-23T08:36:40.983Z
@Gyan I added the outputs. I see that the encoder changes, maybe that might be the culprit...?
su_li
CC BY-SA 4.0
2020-04-23T18:33:17.177Z
The log from `ffmpeg -i inputfile.mkv -map 0:v -map 0:s -map 0:a:1 -c copy outputfile.mkv` may be more informative.
llogan
CC BY-SA 4.0
2020-04-26T19:48:30.553Z
@llogan See second edit above for the requested log output.
su_li
<ffmpeg><mkv><vlc>
No sound on Windows Media Player after removing unneeded audio streams with ffmpeg
su_li
# No sound on Windows Media Player after removing unneeded audio streams with ffmpeg

(Asked by: username_0 on 2020-04-22)

In some .mkv files with multiple different audio streams I removed all the ones I don't need with ffmpeg and only kept the desired audio stream along with the video and possibly subtitles.
The result works fine in VLC, but in Windows Media Player I don't have any sound after the repacking. I do wonder what the issue is. Anything incorrect with the process? How could I achieve that it still works with WMP after the removal of certain audio streams.
Note: The audio works well in WMP with the original file.
Here's what I use to remove the unneeded streams. Let's say I have a file with three audio streams and I only want to keep the second one:
ffmpeg -i inputfile.mkv -map 0:v -map 0:s -map 0:a:1 -c copy outputfile.mkv

Edit:
ffmpgeg -i  output before and after removing.
I notice that the encoder changes, maybe that causes issues for WMP?
ffmpeg -i in.mkv

ffmpeg version git-2020-04-17-889ad93 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200328
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 80.100 / 58. 80.100
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, matroska,webm, from 'in.mkv':
  Metadata:
    title           : test
    encoder         : libebml v0.7.7 + libmatroska v0.8.1
    creation_time   : 2011-09-25T09:17:25.000000Z
  Duration: 01:31:44.83, start: 0.000000, bitrate: 13668 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
    Metadata:
      title           : MVO
    Stream #0:2(rus): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : DUB
    Stream #0:3(rus): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : Mihalev
    Stream #0:4(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Metadata:
      title           : DTSHD core5.1 1536k
    Stream #0:5(rus): Subtitle: subrip (default)




ffmpeg -i out.mkv

ffmpeg version git-2020-04-17-889ad93 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200328
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 80.100 / 58. 80.100
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, matroska,webm, from 'out.mkv':
  Metadata:
    title           : test
    ENCODER         : Lavf58.42.100
  Duration: 01:31:44.83, start: 0.000000, bitrate: 12842 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Metadata:
      DURATION        : 01:31:44.828000000
    Stream #0:1(rus): Subtitle: subrip (default)
    Metadata:
      DURATION        : 01:26:07.385000000
    Stream #0:2(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Metadata:
      title           : DTSHD core5.1 1536k
      DURATION        : 01:31:44.273000000


EDIT 2:
Log output of ffmpeg -i inputfile.mkv -map 0:v -map 0:s -map 0:a:1 -c copy outputfile.mkv
ffmpeg -i inputfile.mkv -map 0:v -map 0:s -map 0:a:1 -c copy out.mkv
ffmpeg version git-2020-04-17-889ad93 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200328
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 42.102 / 56. 42.102
  libavcodec     58. 80.100 / 58. 80.100
  libavformat    58. 42.100 / 58. 42.100
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 77.101 /  7. 77.101
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, matroska,webm, from 'inputfile.mkv':
  Metadata:
    title           : test
    encoder         : libebml v0.7.7 + libmatroska v0.8.1
    creation_time   : 2011-09-25T09:17:25.000000Z
  Duration: 01:31:44.83, start: 0.000000, bitrate: 13668 kb/s
    Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc (default)
    Stream #0:1(rus): Audio: ac3, 48000 Hz, 5.1(side), fltp, 448 kb/s (default)
    Metadata:
      title           : MVO
    Stream #0:2(rus): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : DUB
    Stream #0:3(rus): Audio: ac3, 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : Mihalev
    Stream #0:4(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Metadata:
      title           : DTSHD core5.1 1536k
    Stream #0:5(rus): Subtitle: subrip (default)
Output #0, matroska, to 'out.mkv':
  Metadata:
    title           : test
    encoder         : Lavf58.42.100
    Stream #0:0(eng): Video: h264 (High) (H264 / 0x34363248), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 23.98 fps, 23.98 tbr, 1k tbn, 1k tbc (default)
    Stream #0:1(rus): Subtitle: subrip (default)
    Stream #0:2(rus): Audio: ac3 ([0] [0][0] / 0x2000), 48000 Hz, stereo, fltp, 192 kb/s
    Metadata:
      title           : DUB
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:5 -> #0:1 (copy)
  Stream #0:2 -> #0:2 (copy)
Press [q] to stop, [?] for help
frame=131984 fps=941 q=-1.0 Lsize= 7741970kB time=01:31:44.70 bitrate=11521.5kbits/s speed=39.3x
video:7611378kB audio:128246kB subtitle:66kB other streams:0kB global headers:0kB muxing overhead: 0.029470%

**Tags:** ffmpeg, mkv, vlc

> **Comments:**
> **username_1**: Share the full log of `ffmpeg -i file` for both input and output.  
> **username_0**: @username_1 I added the outputs. I see that the encoder changes, maybe that might be the culprit...?  
> **username_2**: The log from `ffmpeg -i inputfile.mkv -map 0:v -map 0:s -map 0:a:1 -c copy outputfile.mkv` may be more informative.  
> **username_0**: @username_2 See second edit above for the requested log output.  

---

## 0 answers

