Suffix

Matroska .mkv files in Synology’s DS Video app

Playing Matroska files via Synology’s DS Video app on iOS.

Matroska, recognizable by the .mkv extension, is a media container format. It can hold video, audio, pictures, and subtitles in a single file. Think of it as a ZIP archive for videos.

I am trying to understand why some .mkv files cannot be played by the iOS DS Video app, a companion video player for the Synology NAS. The Synology DS Video iOS app is finicky when it comes to video formats. Certain videos play in the Synology web app but not in the iOS app, while others play in the app but not on the web.

MP4 Always Works

Comparing a working with a non-working Matroska file showed both contained MP4 video files, so I gave up trying to understand the world of video codecs and blamed the weird Synology iOS app. Converting the Matroska files to MP4 fixed the issue. Converting a video from one format to another takes time though and loses a bit of quality each time. Annoying.

Finding the Culprit: Audio

Fast-forward a few months and another .mkv file that can’t be played. Taking a closer look showed no difference between the video files, but the audio had different encodings! The working one had an AC-3 audio track, the non-working an E-AC-3 one. Enhanced AC-3 is the newer audio format, AC-3 the older one. I removed the audio track from the Matroska container and… the DS Video app happily played the video. Progress!

Now that I learned the DS Video iOS app has problems playing Digital Dolby Plus audio (another name for E-AC-3) I no longer need to convert the whole MKV to MP3: simply re-encoding the audio track is way faster!

FFmpeg to the Rescue

First, I make sure the audio is indeed E-AC-3 using ffprobe, an FFmpeg companion program. Next, I convert the E-AC-3 audio track to AC-3 via a command I found on the VideoHelp Forum.

ffprobe -v error -show_streams input.mkv | grep codec_name
ffmpeg -y -i input.mkv -c:a ac3 -b:a 640k output.mkv

Surprise, surprise, DS Video now plays the video without complaining.

Wrong Profile

Later I found another video that would not play in the DS Video app but would open in the DS File app. ffprobe showed “profile=Main 10” for the non-working video and “profile=High” for the working one. Converting the video to YUV420P did fix it.

ffprobe -v error -show_streams input.mkv  | grep profile
ffmpeg -i input.mkv -vf scale='2*trunc(iw/2)':-2 -pix_fmt yuv420p -c:v libx264 -profile:v high output.mkv 

Subtitles

Now that I finally understand the issue, it might be time to look at a different iOS video player. Not only is the DS Video app picky with video and audio formats, it also has this weird subtitle issue where it won’t find subtitles if the DS File iOS app is not installed on the same device. ¯\_(ツ)_/¯ I didn’t even know iOS apps could depend on each other.