Blog

Thoughts from my daily grind

Fix MKV Video Playback Issues

Posted by Ziyan Junaideen |Published: 09 September 2020 |Category: General
Default Upload |

The quality of a video has 3 aspects. They are video resolution, audio quality and playback smoothness. Audio and video quality depend on the production. Video playback quality depends on the device. Some devices don't have the hardware to decode video resulting bad playback. Some devices software issues affecting playback smoothness. If any of these are compromised watching a video is not entertaining.

MKV with the file extension .mkv is a popular open standard file format that can include any number of audio, video, image/picture and subtitle tracks. Its capabilities are fascinating. Yet I have experienced playback related issues with respect to MKV files in Ubuntu irrespective of the player I am using.

Video Players

I have only tried the default Videos player that come with Ubuntu 20.04 and VLC which is my preferred player.

I have noticed that the Videos player has many issues. Most of the time it is choppy playback and some times it takes a long time to open the video. When I say “choppy” I mean the video play back is not smooth. Its loosing frames and its obvious and painful to watch such a video.

This is not the case, at least most of the time, with VLC. It plays most videos without issue. How ever today I experienced an exception.

It wouldn’t run at all in Videos app. In VLC Media Player, it will play without issue. But if you move forward in the timeline from that point on there is no audio.

Solution

Converting the MKV files to MP4 using ffmpeg made the video file watchable without issue from both Videos and VLC players. If you are having a MKV file that is stubborn to playback converting to a format that players are more comfortable playing, like MP4, might be helpful.

If you are in Ubuntu…

sudo apt install ffmpeg
fmpeg -i source.mkv  -codec copy output.mp4

Hope this was helpful. Thanks for the guys who maintain ffmepg as it has saved me more than once. Some times I even use it to add effects like speed ramping with motion blur.

Conclusion

Video playback is the result of both software and hardware. Before HD came to the mix, the processor could decode video real-time. Since special hardware (GPUs) are used to process videos. Most computers these days come with integrated graphics that is good enough to process videos. When I converted the MKV file to MP4, it all completed in a matter of seconds, a HD video that is almost an hour long. Thus I don't believe this is the case of a hardware limitation.

I believe the issues are related to the software that is responsible to decode the video used by the players. It doesn't seem to be efficiently utilizing the hardware. The best way I see to overcome this is by converting to MP4 which seems to be better supported across all players.

Tags
About the Author

Ziyan Junaideen -

Ziyan is an expert Ruby on Rails web developer with 8 years of experience specializing in SaaS applications. He spends his free time he writes blogs, drawing on his iPad, shoots photos.

Comments