[SOLVED] Guide to Making MKV Audio Work on Your Device (Roku, Etc.)

Appletax

Well-Known Member
Reaction score
348
Location
U.P. of Michigan
If you have MKV videos and only the video plays and not the audio, you can:

1. On PC/Mac, use VLC Media Player as it supports many video & audio codecs.
2. Stream the video from your PC to your device using Plex Media Server.
3. Convert the audio to a different codec (see below).

Typical issue: the MKV's audio is DTS (usually, but not always). The device (e.g. Roku) does not decode DTS - it does "passthrough" - it passes the audio to your TV, which (if you have the equipment), will send the audio stream to your surround sound system or soundbar.

No DTS speaker, no audio.

One solution: use a video converter program, such as Handbrake.

Problem: the program will re-encode the video and the audio (you just need to re-encode the audio), which results in a very time consuming and inefficient procedure. Re-encoding video requires serious CPU power.

Best solution: use FFmpeg, a free, complete, cross-platform solution to record, convert and stream audio and video.

Reason: simple, super fast, very powerful/customizable. It will copy the video (no re-encoding) and re-encode the audio only.


** How to Use FFmpeg to Convert MKV Audio for Compatibility **


1) Download FFmpeg [choose: release build (bottom option) + your architecture + static]


2) Inside the zip file you'll find a folder called 'bin' and a file in there called 'ffmpeg.exe'. Copy that file somewhere in your path where your videos are.


3) Open the command prompt (cmd) and work your way to the directory containing the videos.


E.g.: cd \Users\<your username>\Videos


4) Use the command: ffmpeg -i input.mkv -c:v copy -c:a aac -ac 2 -b:a 256K output.mp4

Example:

ffmpeg -i "National Treasure.mkv" -c:v copy -c:a aac -ac 2 -b:a 256K "National Treasure.mp4"


How the command works:
- ffmpeg - use the program
- i - input something
- input.mkv - input file (your video)
- c:v copy - [codec:video] copy - copies the video stream (no quality change) and does not re-encode it - makes this process very fast
- c:a aac - [codec:audio] - switches to the audio stream and re-encodes in the AAC codec, which Roku can decode
- ac 2 - set # of audio channels to 2 (stereo)
- b:a 256K- sets audio bitrate to 256
- output.mp4 - your output video name; switches container type to MP4


Misc:
> You can see video information by using ffmpeg -i movie.mkv. It shows you the audio codec used. MKV container + AAC audio will work fine.
> Roku audio and video support.
> This command uses a small amount of CPU processing time and a lot of disk time. Only way to speed this process up is to do this on an SSD.
 
Last edited:
... my OCD says I gotta get this verified by someone who knows what they are doing
I suspect that there are very few that know what they're doing (with any certainty) with ffmpeg! ;)

Your command looks okay to me (but see above – I am not one of the few ...) and your analysis of the command parts is correct. You can experiment with (i.e., increase) the output bitrate if you hear any artefacts.
 
I use MakeMKV to pull my own media, and I usually get the 7.1 and the 5.1 audio tracks, Android based players cannot play back 8 channel audio, and when you try bad things happen. So when I have both, Plex lets me pick one that works and life goes on. I've used Handbreak in some circumstances, but I try to avoid it.

The one problem I do need to figure out, for some reason 7.1 audio is quieter than the 5.1, so when you watch a blueray on plex, then turn around and fire up a DVD... plug your ears!
 
Back
Top