Vlc not playing .mkv?

Here is how i solve this problem.

  1. I tried this solution and it did not work for me but it gave me an idea to ask chatgpt.
  2. from chatgpt response together with the above solution, i solved the problem on my fedora 40 laptop with 4 steps:

step 1: sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm sudo dnf install vlc

step 2: sudo dnf install gstreamer1-libav gstreamer1-plugins-ugly

step 3: sudo dnf autoremove

step 4: sudo dnf group upgrade --with-optional Multimedia --allowerasing

I hope that helps someone like me who does not want to install the flathub version of vlc. :slightly_smiling_face:

1 Like

Hi @675mrdee and welcome, is there a specific reason why you didnā€™t want to install the flathub version?

Regarding the MKV playback, itā€™s perhaps good to note that MKV isnā€™t a video format but rather a container. Inside the container are the actual media files which can consist of a variety of different codecs. So it may depend on the contents of the MKV which plugins are needed in order to get a working playback.

Reasons are mostly immaterial. The rpm version works well without the overhead of a flatpak and the necessary runtime packages. Users are free to choose without needing to justify their decision.

Your comment about the mkv container and required codecs is spot on. The codec issue is mainly what is managed by doing the group upgrade of the Multimedia group.

Just as an aside comment.
I use totem (videos), mpv and vlc among other multimedia tools and do not have any flatpaks installed to support multimedia. I am able to play all forms of multimedia I have encountered to date.

I was just curious, iā€™m allowed to ask arenā€™t i? That remark about ā€˜not needing to justifyā€™ feels a little unnecessary to be honest.

1 Like

Of course you are allowed to ask. I interpreted that as a suggestion which seemed to imply he should use the flatpak when he had already stated

This is off topic, since he merely showed us how he solved the problem and was adverse to using the flatpak.

I apologize for upsetting you with that comment.

@675mrdee
Please mark your original post as the solution since this appears to be an information only topic.

I tried this solution for Fedora 40. It does not work. The issue affects all video players, like Clapper, not just VLC.

I am new to Linux, but Iā€™ve been in IT since the early 90ā€™s. H.265 ought to work. Is this an install issue? A version issue? Permissions? The fact it affects other players means this isnā€™t a VLC issue. It has to be OS level.

Itā€™s an install issue. You need the H265 codec which is not installed by default on Fedora due to there not being an free / open source version of it. So you have the option to either install a non-free version of it through RPM Fusion, or install a flatpak version of a mediaplayer that includes itā€™s own codec pack.

I am already using the flatpack version of VLC for Fedora. It actually says it has the HEVC/H.265 video demuxer installed, yet when I try to run a .mkv file in VLC it fails to decode it and plays audio, no video, exactly like everybody else has been complaining about. When I tried this with different video players, I get the same error with each.
I find this really weird, but like you said, it isnā€™t free or open source codec/container player. Perhaps VLC will fix this, though showing its already installed really is confusing to say the least. It seems like its somehow getting blocked or making a function call to the OS? I will contact VLC to let them know their software isnā€™t working.

I donā€™t have trouble playing H265 here locally with the flatpak VLC, iā€™m using the flathub version:

I am still getting ā€œcodec not supportedā€ with VLC 3.0.21 Vetinari version of VLC. On Windows, VLC plays MKVs without any problems. On Fedora 40 Linux it does not work. Iā€™ve used the VLC from the built in installer program, which is part of why I chose Fedora in the first place. Why does MKV suddenly need H.265 when its literally worked for years without it? Yes, on a different OS, but MKV is an open source free protocol. So demanding non-free HEVC now? That doesnā€™t make sense. Which version of VLC are you using and where did you get it?

You need this. :smiley:

https://rpmfusion.org/Howto/Multimedia

You might find some conflicting packages, so you will need to be careful.

:+1:

1 Like

MKV is a container format not a video codec. Inside an MKV can be various kinds of video (and audio) formats, for instance h264, h265, VP9 or AV1.

Which version of VLC are you using and where did you get it?

Like i said iā€™m using the flathub version, itā€™s currently at 3.0.21.

1 Like

I did not realize that MKV worked that way. Thank you for the clarification. Testing older MKV files in my library shows they still work on VLC. It looks like the newer ones are the problem, requiring this H.265 codec. I will investigate these instructions and see if I can get the H.265 files to work.

I think you are confusing MKV (a multimedia container) with the AV codecs needed to play the contained multimedia (audio & video) streams.

Regardless of the container used (AVI, MKV, MP4, etc.) the content still must be processed by the codecs before it may be displayed.

Fedora is restricted from distributing many of the codecs due to their nature and not being open source. However, it is very easy to install almost all of the codecs needed for multimedia from rpmfusion.
The 2 main packages that handle that are ā€˜ffmpegā€™ and ā€˜libavcodec-freeworldā€™ either or both of which may be installed on fedora from the rpmfusion repos as long as dnf is used with the --allowerasing option.

Important step and is first one of Howto/Multimedia - RPM Fusion

Switch to full ffmpeg

sudo dnf swap ffmpeg-free ffmpeg --allowerasing

Following,

Install additional codec

sudo dnf update @multimedia --setopt=ā€œinstall_weak_deps=Falseā€ --exclude=PackageKit-gstreamer-plugin

That should do to play .mkv files with vlc

1 Like

Thank you everyone. Your advice worked. It is now playing H.265. Hopefully this will be automated in future. This file type is becoming more common.

Probably not in the forseeable future.
The codec (along with many others) cannot be freely distributed and requires the user to explicitly install those codecs per the instructions. Blame the copyright and licensing laws for that.

Which solution did work for you?

The link you provided to the exact terminal code is what worked for me. The first two times I tried those they didnā€™t work, so I waited a couple days and tried again. This time the terminal pword and installation codes actually ran properly, which then allowed my library of HEVC encoded MKV files to run.
I wonder if giving the user a button to press to ā€˜install proprietary codecs for H.265ā€™ would satisfy the legal ā€œuser installedā€ answer and still work with the Fedora charter/rules? Or perhaps one of those flatpacks in the GNOME Software installer program. If it isnā€™t preinstalled, and the user chooses to install it, then that wouldnā€™t be a violation, right? I realize that sounds like legal sleight of hand, but it is illegal for a US librarian to copy a page of text from a book for a patron, but the patron can do it themselves legally. The difference is a matter of arrest and criminal penalties.

1 Like

Those two repos deserve to be in the third party list. This will help a user to install all media codecs during the initial set up. We are not there yet, but we will be there for sure. :classic_smiley:

Could you please mark that post as a solution, so this thread could be visible as solved for everybody around? @mattdm