.mkv files not working properly

.mkv files lag on playing (frame rates skip and lag as video is slower then the audio ) also i get higher cpu usage when playing content of those files ive used all players available on linux eg- mpv,vlc,haruka
nothin works is there drivers i had to install for it to work properly if yes then how?

By default, you won’t have hardware assisted video decode.

You can fix that by following this:

https://wiki.archlinux.org/title/Hardware_video_acceleration

The exact steps vary depending on your hardware.

2 Likes

thnks man it works now when i installed intel media drivers

2 Likes

Something to note too, .mkv is just a container (as is .mp4, .mov, etc).

How the video/audio is decoded, and what hardware acceleration is available, depends on the contents of the .mkv file (what codecs are used for video and audio).

2 Likes

how can we check what codecs are used / missing like mpv has no options to see that

In VLC, you’d go to Tools > Codec Information.

If you run MPV from the command line, it does give you a little info on codecs (H.264 and MP3 in this case). There may be a way to get more, but you might need to dig through the command options.

 (+) Video --vid=1 (*) (h264 1920x1080 30.000fps)
 (+) Audio --aid=1 (*) (mp3 2ch 48000Hz)
     Audio --aid=2 (*) (ac3 6ch 48000Hz)
File tags:
 Artist: Blender Foundation 2008, Janus Bager Kristensen 2013
 Comment: Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
 Composer: Sacha Goedegebure
 Genre: Animation
 Title: Big Buck Bunny, Sunflower version
AO: [pipewire] 48000Hz stereo 2ch floatp
VO: [gpu] 1920x1080 yuv420p
(Paused) AV: 00:00:02 / 00:10:34 (0%) A-V: -0.000

You can also use ffprobe to get detailed codec information:
ffprobe somefile.mp4

ffprobe version n6.1.1 Copyright (c) 2007-2023 the FFmpeg developers
...
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'bbb_sunflower_1080p_30fps_normal.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2013-12-16T17:44:39.000000Z
    title           : Big Buck Bunny, Sunflower version
    artist          : Blender Foundation 2008, Janus Bager Kristensen 2013
    comment         : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
    genre           : Animation
    composer        : Sacha Goedegebure
  Duration: 00:10:34.60, start: 0.000000, bitrate: 3481 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 2998 kb/s, 30 fps, 30 tbr, 30k tbn (default)
    Metadata:
      creation_time   : 2013-12-16T17:44:39.000000Z
      handler_name    : GPAC ISO Video Handler
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: mp3 (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 160 kb/s (default)
    Metadata:
      creation_time   : 2013-12-16T17:44:42.000000Z
      handler_name    : GPAC ISO Audio Handler
      vendor_id       : [0][0][0][0]
  Stream #0:2[0x3](und): Audio: ac3 (ac-3 / 0x332D6361), 48000 Hz, 5.1(side), fltp, 320 kb/s (default)
    Metadata:
      creation_time   : 2013-12-16T17:44:42.000000Z
      handler_name    : GPAC ISO Audio Handler
      vendor_id       : [0][0][0][0]
    Side data:
      audio service type: main

If using an up to date version of ffmpeg, VLC or MPV and they’re in working order (no broken dependencies), the issue of “missing codecs” is going to be pretty rare. There was a time when we needed to specifically install video and audio codecs in order to make use of video files and such, to the extent of installing entire packs loaded with them. Those days, with only a few exceptions, are largely behind us.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.