[FFmpeg-user] MP4-Video does not play audio on Android 8; audio stream size tagged wrong

Ferdi Scholten ferdi at sttc-nlp.nl
Tue Oct 24 09:12:54 EEST 2023

> I have a Matroska video with libx264 video and libvorbis audio. when I 
> copy it to MP4 container, the resulting video does not play audio on 
> Android 8 phone -> "Audio-Codec not supported"
> Matroska: http://jugkoeln.de/Projects/ffmpeg/K%C3%B6nig_de_3.mkv
> MP4:   http://jugkoeln.de/Projects/ffmpeg/K%C3%B6nig_de_3.mp4
> But the Matroska video with the same audio stream plays flawlessly.
> So I guess, there must be something wrong in with the meta data in the 
> MP4 container. The ffprobe output shows a kind of weird or incomplete 
> (see below).
> Can one help me, to check this out?
> Additionally:
> From ffmpeg output, the audio stream is 1991 kiB, so with 3 min. 
> duration it has 90.6 kb/s.
> According to mediainfo for Matroska file:
> audio codec:          Vorbis / A_VORBIS    <- correct
> audio stream size:   2.40 MiB     <- wrong
> Bit rate mode:         Variable     <- correct
> audio bit rate:        112 kb/s     <- wrong
> According to mediainfo for MP4 file:
> audio codec:          Ogg / mp4a-DD     <- wrong
> audio stream size:   1.94 MiB     <- correct
> Bit rate mode:         Constant     <- wrong
> audio bit rate:        90.6 kb/s     <- correct
> So in both files some metadata seems wrong.

Vorbis audio is officially not supported by the mp4 container 
Matroska does not have this problem as it supports almost all known codecs.

These are the audio codecs that are in the mp4 specifications: AAC, ALS, 
SLS, MP3, MP2, MP1, CELP, HVXC, TTSI, SAOL, Apple Lossless, FLAC, Opus
Others can be muxed in, but most players will not support playing those.

More information about the ffmpeg-user mailing list