How to install h.264 decoder?
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.
Related videos on Youtube
sonakshi
Updated on September 18, 2022Comments
-
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 over 10 yearswhich video format you are trying to play?? and by the way have you installed Ubuntu-restricted-extras??
-
sonakshi over 10 yearsyes the restrictd packages are installd
-
Sukupa91 over 10 yearsinstall h264enc causing the error as mentioned by rajagenupula..
-
strpeter about 10 yearsThe reader of this question might also want to have a look at the question askubuntu.com/q/214421/217269 (about multimedia decoders)
-
-
sonakshi over 10 yearsthe gstreamer-plugin that u mentiond is n being able to b instald..it shows some eror like this isnt availble in ur software
-
sonakshi over 10 yearsi tried aftr d whole procedure,postfix configuration popped up..but nothing hapened
-
sonakshi over 10 yearsi tried something and now finally i can c d video...thnx alot everyone for ur help..:)
-
fohswe over 10 yearsThe package was probably not available because you hadn't activated the multiverse repository, as I wrote you might have to do :)
-
HarlemSquirrel over 10 yearsIsn't this the encoder, not the decoder?
-
mc0e over 8 yearsh264enc 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 over 6 yearsTried
sudo apt-get install h264enc
, but Ubuntu says it is not available. Triedapt-cache search h264enc
but got nothing. -
mx7 over 6 years@CraigS.Anderson make sure you have "multiverse" repository enabled. packages.ubuntu.com/search?keywords=h264enc
-
Alex over 3 yearsI installed all kinds of packages to no effect, and this is the only thing that worked.
-
Ahmad Javadi Nejad about 3 yearsfinally , only thing that worked.
-
Sephethus about 3 years*DEcoder not ENcoder
-
Sephethus about 3 yearsThis doesn't actually work. Every website says to do this, but in Ubuntu 20.0.4, this will not work.
-
egvo almost 3 yearsIt says: Package 'gstreamer0.10-ffmpeg' has no installation candidate
-
Organic Marble over 2 yearsWorked on 20.04
-
Admin about 2 yearsVLC worked for me, mp4 videos were playing randomly, now everything looks correct with VLC. Thanks!