Ffmpeg and m4a configuration

On the Dashboard I get the following (non-critical) error message:

You are missing support for the following HTML5 codecs: m4a. To fully support HTML5 browser playback you will need to install programs that can not be distributed with FreePBX. If you’d like to install the binaries needed for these conversions click ‘Resolve’ in the lower left corner of this message. You can also safely ignore this message but browser playback might not work in your browser.

Followed by a link to:
http://wiki.freepbx.org/display/FOP/Installing+Media+Conversion+Libraries

This states:

MP4 (M4A)
MP4/M4A files are usually generated through a program called FFMPEG. There are several install guides for FFMPEG online. A good starting point would be: https://www.ffmpeg.org/

In no particular order, I have installed: (with path shown in Advanced Settings)

mpg123: /usr/bin/mpg123
lame: /usr/local/bin/lame
ffmpeg: /root/bin/ffmpeg
sox: /usr/bin/sox

From the CLI:

:~/bin# ffmpeg -codecs

ffmpeg version N-82777-gda3c69a Copyright (c) 2000-2016 the FFmpeg developers
  built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-11)
  configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --bindir=/root/bin --enable-gpl --enable-libfdk-aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree
  libavutil      55. 41.101 / 55. 41.101
  libavcodec     57. 66.109 / 57. 66.109
  libavformat    57. 58.101 / 57. 58.101
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 68.100 /  6. 68.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
Codecs:

(Long list which includes)
DEV.L. mpeg4                MPEG-4 part 2 (decoders: mpeg4 mpeg4_cuvid )

and

D.A.L. mp1                  MP1 (MPEG audio layer 1) (decoders: mp1 mp1float )
 DEA.L. mp2                  MP2 (MPEG audio layer 2) (decoders: mp2 mp2float ) (encoders: mp2 mp2fixed )
 DEA.L. mp3                  MP3 (MPEG audio layer 3) (decoders: mp3 mp3float ) (encoders: libmp3lame )
 D.A.L. mp3adu               ADU (Application Data Unit) MP3 (MPEG audio layer 3) (decoders: mp3adu mp3adufloat )
 D.A.L. mp3on4               MP3onMP4 (decoders: mp3on4 mp3on4float )
 D.A..S mp4als               MPEG-4 Audio Lossless Coding (ALS) (decoders: als )

I don’t see MP4 or m4a specifically mentioned and I must assume, therefore, that “mp4als” or “mpeg4” are not the same thing, or I wouldn’t be seeing this error.

If this is correct, would someone helpfully guide me as to how I can add mp4 / m4a to the ffmpeg codecs list?

I have searched through the ffmpeg website and found it both difficult and confusing for me. I would appreciate any guidance from someone who has done this before.

Kind regards

Andy Woolford

1 Like

hi, did you ever resolve this? i am having the same issues.

If you actuallY have ffmpeg installed successfully , just

mysql asterisk -e ‘delete from notifications’

and it wont come back

hi, im not sure that ffmpeg is installed correctly. I just tried converting a file manually and get the error “Unknown encoder ‘libfdk_aac’”.?

After following the instructions /trac.ffmpeg.org/wiki/CompilationGuide/Centos the html warning no longer pops up, but is still there in the browser console.

im wondering if it has anything to do with this comment…

“Note that this guide performs a “local installation” into the ~/bin directory of the user following the guide: this is to avoid conflicts with the package management system, system files, and repository packages. Also, it allows a non-superuser to compile, such as on a shared server (assuming the build dependencies, like make , are available). This works fine for most users, but depending on your needs you may have to move the binary somewhere else in your PATH environment variable.”

i moved ffpmeg into /usr/bin/ffmpeg and its now converting files correctly from the cli. However still no luck on the ipad browser. It has the same errors in the console log-

POST jquery-3.1.1.min.js?load_version=v15.0.6.3:4 POST http://192.168.1.102/ucp/ajax.php 500 (Internal Server Error)

INTERNAL SERVER ERROR: jsphpg_a84f8885e18c7255b6baebc581baad46.js?load_version=v15.0.6.3:2431 Internal Server Error: MP4 and M4A are not supported by FFMPEG

/var/www/html/admin/libraries/media/Media/Driver/Drivers/FfmpegShell.php: 128

i changed enable-libfdk-aac to enable-libfdk_aac on line 128 in FfmpegShell.php and it now works!

minor bug on ipad that you have to press play twice. First time seems to convert the file, second time plays it.