How to install h.264 decoder?

178,434

Solution 1

If you want the H.264 encoder, then

sudo apt-get install h264enc

will install H.264 in your system.

Solution 2

In order to play H.264 encoded videos the corresponding decoder comes with the following library:

sudo apt install gstreamer1.0-libav

Solution 3

The package that fixed it for me on 16.04 is the gstreamer plugins bad. I got a message about Python-3.5 minimal wanting to install some MPEG-4 AAC plugin, which did not do anything. To fix: In a terminal type:

sudo apt-get install gstreamer1.0-plugins-bad

If you still can't get it to work somehow, you can try VLC as a workaround, installable by:

sudo apt-get install vlc

I did not unclick the restricted software, that may work but may disable other codecs. By the way, movie player or Video is the Totem video player.

Solution 4

I think this is part of the package gstreamer-plugins-bad. If you search for this in Software Center it should show up. It might be that you have to activate the multiverse repository (start Software & Sources and tick the appropriate box for this).

After you have installed the package, Movie Player should be able to play the file.

Solution 5

The audio-only gstreamer bug can easily be resolved

Hearing only audio on H.264 playback with an otherwise black video screen was reported as gstreamer1.0 bug #1562875.

Luckily, this bug can easily be resolved by issuing the following command once:

$ rm -R ~/.cache/gstreamer-1.0

This will take effect after restarting the application.

Share:
178,434

Related videos on Youtube

sonakshi
Author by

sonakshi

Updated on September 18, 2022

Comments

  • sonakshi
    sonakshi almost 2 years

    I tried playing videos in movie player but only the audio could be heard. I tried playing the video with dragon player but here also only the audio could be heard.

    A message box appeared showing the following message:

    Python (v2.7) requires to install plugins to play media files of the following type: H.264 decoder

    I tried installing the plugin but it couldn't be installed. It isn't available in the software center too. How can I get this plugin?

    • Sukupa91
      Sukupa91 over 10 years
      which video format you are trying to play?? and by the way have you installed Ubuntu-restricted-extras??
    • sonakshi
      sonakshi over 10 years
      yes the restrictd packages are installd
    • Sukupa91
      Sukupa91 over 10 years
      install h264enc causing the error as mentioned by rajagenupula..
    • strpeter
      strpeter about 10 years
      The reader of this question might also want to have a look at the question askubuntu.com/q/214421/217269 (about multimedia decoders)
  • sonakshi
    sonakshi over 10 years
    the gstreamer-plugin that u mentiond is n being able to b instald..it shows some eror like this isnt availble in ur software
  • sonakshi
    sonakshi over 10 years
    i tried aftr d whole procedure,postfix configuration popped up..but nothing hapened
  • sonakshi
    sonakshi over 10 years
    i tried something and now finally i can c d video...thnx alot everyone for ur help..:)
  • fohswe
    fohswe over 10 years
    The package was probably not available because you hadn't activated the multiverse repository, as I wrote you might have to do :)
  • HarlemSquirrel
    HarlemSquirrel over 10 years
    Isn't this the encoder, not the decoder?
  • mc0e
    mc0e over 8 years
    h264enc is "A shell script which makes it easy to encode DVDs or video files to the H.264/AVC/MPEG-4 Part 10 video format using MEncoder from the MPlayer project". That doesn't sound like the codec that's wanted, but converting the videos might be a fallback option.
  • Craig S. Anderson
    Craig S. Anderson over 6 years
    Tried sudo apt-get install h264enc, but Ubuntu says it is not available. Tried apt-cache search h264enc but got nothing.
  • mx7
    mx7 over 6 years
    @CraigS.Anderson make sure you have "multiverse" repository enabled. packages.ubuntu.com/search?keywords=h264enc
  • Alex
    Alex over 3 years
    I installed all kinds of packages to no effect, and this is the only thing that worked.
  • Ahmad Javadi Nejad
    Ahmad Javadi Nejad about 3 years
    finally , only thing that worked.
  • Sephethus
    Sephethus about 3 years
    *DEcoder not ENcoder
  • Sephethus
    Sephethus about 3 years
    This doesn't actually work. Every website says to do this, but in Ubuntu 20.0.4, this will not work.
  • egvo
    egvo almost 3 years
    It says: Package 'gstreamer0.10-ffmpeg' has no installation candidate
  • Organic Marble
    Organic Marble over 2 years
    Worked on 20.04
  • Admin
    Admin about 2 years
    VLC worked for me, mp4 videos were playing randomly, now everything looks correct with VLC. Thanks!