Can't record or play MP4 files

Greetings,

I am using Fedora 40. I can’t get MP4 files to record or play. For example, when I try to play an MP4 file with vlc, I get:

Codec not supported:
VLC could not decode the format "h264" (H264 - MPEG-4 AVC (part 10))
Codec not supported:
VLC could not decode the format "mp4a" (MPEG AAC Audio)
Codec not supported:
VLC could not decode the format "mp4a" (MPEG AAC Audio)
Codec not supported:
VLC could not decode the format "h264" (H264 - MPEG-4 AVC (part 10))

I tried things like:

sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
sudo dnf install ffmpeg ffmpeg-libs
sudo dnf install gstreamer1-libav gstreamer1-plugins-good gstreamer1-plugins-bad-free gstreamer1-plugins-bad-freeworld gstreamer1-plugins-ugly

With no luck. I’ve tried many other steps too all to no avail. Sure would appreciate some help.

Thanks!

1 Like

Added rpmfusion, video-codecs, vlc

I am not sure VLC uses gstreamer

https://mirror.dst.ca/rpmfusion/free/fedora/releases/40/Everything/x86_64/os/repoview/letter_v.group.html

Try

sudo dnf install vlc-plugins-freeworld

Didn’t help. But thanks!

My problem is not only with vlc. I’m just using it as an example. Several other programs can’t record or play MP4 files.

The problem is not associated with any particular MP4 file or program. It is with the MP4 format in general. None of the programs I’ve been using to create, convert, or play MP4 files work. I’ve spent a ton of time trying everything I can think of. Clearly something in the sequence I am using to load up my OS is creating an environment that has many problems.

So, I haven’t tried on a vanilla install because that’s not what I use. I add things like LyX, LaTeX, Java, intellij, emacs, and a ton of other stuff. I don’t have a month of time to figure out where the conflict is occurring. And whether or not it works on a raw install is irrelevant.

libavcodec-freeworld

is the common extension that fixes videos for Firefox, Filemanagers etc.

Actually it is very relevant.

If you do a new clean install, add the codecs needed, and the video player then works it proves the media plays well.

If you then add one or more of the apps you indicated and the MP4s no longer play you can definitively say that installing those packages broke the ability to play multimedia.

My suggestion –
Start clean and add the multimedia packages mentioned to get the MP4 videos to play then as you add each of the extra apps test that it still works.

Most of us have no problems with playing MP4s, and in my case I only added the packages ffmpeg and libavcodec-freeworld both from rpmfusion for every media I have tried since to “just work”.

1 Like

Since vlc moved to fedora it isn’t a good choice, they build it against an unsupported ffmpeg version which means it has no hardware acceleration.
Installing rpmfusion ffmpeg should be enough to make it support most codecs (mp4 is just a container format).
I note from another post you are using nvidia, mpv would be much better as it supports native nvidia hardware acceleration (nvdec).It has several frontends eg: celluloid etc

3 Likes

I installed the flatpak VLC version which seems to support hardware acceleration without needing to install additional codecs.

Another advantage i found was that it follows the dark adwaita theme while the rpm version only supports the default light/grey theme.

It seems to work well on my system.

The version in fedora is ‘ffmpeg-free’.
The version in rpmfusion is ‘ffmpeg’.

The command would be sudo dnf swap ffmpeg-free ffmpeg --allowerasing

1 Like

Can you see what is installed:
sudo dnf list installed \*ffmpeg\* \*libva\* \*h26[45]\* \*gstream\* \*vlc-\*

Thanks

I also install these which are h264 related:

openh264-2.4.1-2.fc40.x86_64
mozilla-openh264-2.4.1-2.fc40.x86_64
gstreamer1-plugin-openh264-1.24.5-1.fc40.x86_64

Thanks a lot for all the help!!

So you mean the mp4’s play now?

Use this one it’ll work sudo dnf install x264 x265

Very helpful thank you. VLC has always been great for me on other distros but has been hopeless on Fedora. MPV has fixed all my problems.

I found it helped to install 2 different packages from rpmfusion for playing mp4 files. x264 and x265

What worked for me after a fresh Fedora 42 installation:

sudo dnf config-manager setopt fedora-cisco-openh264.enabled=1

sudo dnf install vlc

sudo dnf install openh264.x86_64

sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm ( https://rpmfusion.org/Configuration )

sudo dnf swap ffmpeg-free ffmpeg --allowerasing