How to install H.265 / HEVC codec on Ubuntu Linux?

317,766

Solution 1

There is also a PPA for libde265 GStreamer integration. With that installed one can playback H.265 with all GStreamer applications (Browsers, Totem, etc.).

sudo apt-add-repository ppa:strukturag/libde265
sudo apt-get update

Now try playing back a .mkv containing HEVC/H.265 content using any GStreamer-aware player (e.g. "totem"). This should detect the missing codec and prompt to install the libde265 GS plugin (make sure to select the 64bit or 32bit version depending on your architecture).

You can also install the corresponding GStreamer plugin directly:

sudo apt-get install gstreamer0.10-libde265

Or for GStreamer 1.0 applications:

sudo apt-get install gstreamer1.0-libde265

There is also a VLC plugin available:

sudo apt-get install vlc-plugin-libde265

Details here: GStreamer plugin for 4K H.265/HEVC video streaming

Solution 2

An alternative to @longsleep's great answer is, if using VLC: as noted here you can upgrade to VLC 2.2.x or higher to get HEVC/H.265 support. If on 14.04, you need to add this repo to get 2.2.x+ versions of VLC:

sudo add-apt-repository ppa:mc3man/trusty-media

sudo apt-get update, and

sudo apt-get dist-upgrade or sudo apt-get install vlc vlc-plugin-libde265

You can also install others if you want: vlc-plugin-*

The repo doesn't have the gstreamer1.0-libde265 package but does have a lot of other "upgraded, advanced or not normally available multimedia packages for Trusty" 14.04 for those who like LTS versions.

Solution 3

Yet another alternative - if you have Google Chrome installed - is to add/install H.265 / HEVC player (in)to your Chrome browser.

After that, you can head straight to "Google Chrome Applications" (at your Ubuntu distro menu) and run the player. Or you can just start Google Chrome, type in the URL chrome://apps and hit Enter. This will cause Google Chrome to show you its installed apps, so you can run H.265 / HEVC player straight from there.

By using this alternative method, there's no need to install any library, codec, player plugin or whatever, because everything you need for H.265/HEVC playback support is already embedded in the H.265 / HEVC player.

I've already used H.265 / HEVC player to watch a couple of two-hour-long H.265/HEVC encoded movies, and I didn't experience any playback issue.

Share:
317,766

Related videos on Youtube

Majal
Author by

Majal

Servant of the Creator happily married to Jehovah's slave girl. :-)

Updated on September 18, 2022

Comments

  • Majal
    Majal almost 2 years

    I have seen that the new DivX Player 10 shows off H.265/HEVC playback, the successor of H.264. I wonder how I may get this support in Linux. Is there a need to install a codec specific for this format? How?

  • Programster
    Programster almost 10 years
    When I run the vlc-plugin installation I get the following error: vlc-plugin-libde265 : Depends: libvlccore7 (>= 2.1.0) but it is not going to be installed (Ubuntu 14.04)
  • longsleep
    longsleep almost 10 years
    Well Ubuntu 14.04 has libvlccore7. You probably have a newer VLC from a ppa which provides libvlccore8 - uninstall the newer VLC and use the one provided by Ubuntu and you should be fine.
  • muru
    muru over 9 years
    Perhaps this answer needs updating: askubuntu.com/a/544723/158442
  • longsleep
    longsleep over 9 years
    Well - the other answer is valid too if you want to use vlc which did get a HEVC coder in the meantime. Above instructions do work as of current date with Ubuntu 12.04, 14.04 and 14.10. If it does not work for you please let us know exactly what is the problem so we help.
  • Rabbit
    Rabbit over 9 years
    E: Unable to locate package vlc-plugin-libde265
  • soham
    soham about 9 years
    When I run a HEVC encoded video in VLC on Ubuntu 14.04, I see a green layer on top of the video. Any one know how to solve it? @longsleep
  • Buddyshot
    Buddyshot about 9 years
    Guys am I the only one to experience a huge memory leak when trying to read a video with this plugin on totem? My RAM gets filled up after a couple of min, then comes the swap and totem ends up crashing after less than 5min. Any advice?
  • longsleep
    longsleep about 9 years
    What version are you using? I you can provide more details, i am happy to let the developers take a look. I am not aware of any memory leaks.
  • pd12
    pd12 about 9 years
    You can follow ubuntuhandbook.org/index.php/2015/02/… to get VLC with x265 running on 14.04 (it's already in repos 14.10+). The repo there also gives you an x265 package.
  • pd12
    pd12 about 9 years
    @soham.m17 if you're using a Mac & IntelGPU, found this (possibly your bug) from Kodi wiki - kodi.wiki/view/Common_issues
  • soham
    soham about 9 years
    @pd12 I am using Ubuntu.
  • Peter Raeves
    Peter Raeves almost 9 years
    I am using vlc 2.2.0 on ub15.04 and it seems like I can play my x265 encoded 5xxMB video fine, as long as I shut down all other programs, because I am getting really high cpu usage (70-90%) from vlc, while I only get about 5-10% with x264 videos. Is this high cpu usage normal or is it supposed to be much lower, similar to x264?
  • pd12
    pd12 almost 9 years
    With a small sample size (2 vids each for 264, 265) I get 17-26% (about 80-100% of 1 core) CPU usage for x265 and 6-12% for x264. It makes sense because 265 encodes at higher compression ratios with similar quality, so requires more processing work. Also, VLC probably hasn't optimised x265 decoding it yet so it's near the 100% end of 1 core, those are my guesses.
  • Peter Raeves
    Peter Raeves almost 9 years
    I see. Then I guess the high load makes sense on my 7 year old dual core laptop :(
  • Michael
    Michael over 8 years
    @Buddyshot same problem here. Sound stops after some seconds, video continues to play in slowmotion, while the process happily eats one GB after another of my RAM. Did you find any solution for this?
  • Elder Geek
    Elder Geek over 8 years
    After upgrading my system from 32-bit to 64-bit this worked after sudo apt-get install gstreamer0.10-libde265 gstreamer1.0-libde265 (Instructions from the "GStreamer plugin for 4K H.265/HEVC video streaming" link above)
  • Venkatesh
    Venkatesh about 8 years
    It doesn't support sub titles.
  • Yuri Sucupira
    Yuri Sucupira about 8 years
    @Venkatesh If the H.264 video has switchable (embedded) subtitles, the player will detect them and give you the option to select one of them. I have some MKV files with embedded subtitles and on H.265 / HEVC Player I can select any one of these subtitles or disable subtitles. But if you mean loading an external subtitles file (such as a .SRT file), then no: the current version of the player doesn't load external subtitles files.
  • T. Greg O'Neil
    T. Greg O'Neil about 8 years
    "sudo apt-get install vlc-plugin-libde265" worked for me, after first adding the repository!
  • codeScriber
    codeScriber almost 8 years
    for some reason the player doesn't work on my mint 17.2....
  • Yuri Sucupira
    Yuri Sucupira almost 8 years
    @codeScriber I haven't played any H.265 video on the last months, but after seeing your comment I tested the player on Google Chrome (both on 64-bit XUbuntu 16.04 and on 64-bit Mint 17.2) and I can confirm that this Chrome app has stopped working. I performed some tests but was unable to find the problem. I've sent a message to the developer, reporting the problem. In the meantime, it's recommended to use another method (e.g. installing VLC Media Player and the gstreamer integration library).
  • codeScriber
    codeScriber almost 8 years
    Thanks Yuri. I did and it works. Now i need to figure oyt how to make rpi2 plex to decode it while streaming....
  • Jamie Hutber
    Jamie Hutber over 5 years
    This is out of date if you are on ubuntu 17+
  • chaladi
    chaladi almost 5 years
    For bionic or Ubuntu 17+ use following, sudo add-apt-repository ppa:mc3man/bionic-prop sudo apt-get update sudo apt-get install x265
  • Michael
    Michael almost 3 years
    Is this plug-in supposed to work for the video tag on the page? Because it shows a tiny inline video player, but none of the controls respond.
  • Michael
    Michael almost 3 years
    Can you explain what you mean by "browsers"? How can I get the browser to play embedded (video tag) h.265 in any browser under Linux?
  • Yuri Sucupira
    Yuri Sucupira almost 3 years
    @Michael I'm currently running 64-bit XUbuntu 20.04 and HEVC player is playing HEVC (i.e. video) tracks fine in Google Chrome 91.0.4472.114. If you run grep -iR hevc ~/.local/share/applications/ in the shell terminal, you will find the location of such Chrome app, e.g. if such command returns chrome-dambgipgbnhmnkdolkljibpcbocimnpd-Default.desktop, then the ID of your HEVC Player Chrome app is dambgipgbnhmnkdolkljibpcbocimnpd and you therefore should be able to start it by just running google-chrome --app-id=dambgipgbnhmnkdolkljibpcbocimnpd from the shell terminal.
  • Yuri Sucupira
    Yuri Sucupira almost 3 years
    @Michael If you manage to successfully run HEVC Player, you can download a sample HEVC file from s3.amazonaws.com/x265.org/video/Tears_400_x265.mp4 (MP4 is just the file/container extension: the actual video format/codification is HEVC a.k.a. x265 a.k.a. H.265), then on HEVC Player's window click on Open, then change Movie files to All files, select the downloaded Tears_400_x265.mp4 file and then click on Open. Notice that HEVC is a video codec - not an audio codec.
  • Michael
    Michael almost 3 years
    @YuriSucupira Thanks. I can open the HEVC player as a separate window from the extensions page, but I can't seem to play content served from http. As an example, I have a server with something like server.local/app/videos that has a VIDEO tag referencing server.local/videos/20210707.mp4 which is an h.265 encoded video (plays fine under e.g. smplayer) but in the browser i just see a tiny video window on the page that doesn't respond. If I try to open the URL directly in the browser I get the same results. The HEVC player doesn't seem to be able to play from a URL, only local
  • Michael
    Michael almost 3 years
    Or to put it another way, it looks like HEVC player is a standalone player that is for some reason a Chrome extension, despite the fact that it doesn't interact with web pages or Chrome at all. I've already got an external player for playing local files, I would think an extension in the browser would play h.265 embedded in web pages that the browser loads. Am I missing something? Can this extension do that?
  • Yuri Sucupira
    Yuri Sucupira almost 3 years
    @Michael it looks like HEVC player is a standalone player - You hit the nail on the head. It's a standalone player, not an actual plugin (which in such case would play HEVC videos directly in the browser window). For more info, check this question and also this.