How to convert audio.m4a to audio.amr on OS X? - audio

I tried installing ffmpeg
$ brew install ffmpeg
and running ffmpeg
$ ffmpeg -i audio.m4a -ar 8000 -ab 12.2k audio.amr
I got the following error:
Automatic encoder selection failed for output stream #0:0. Default
encoder for format amr (codec amr_nb) is probably disabled. Please
choose an encoder manually. Error selecting an encoder for stream 0:0
I can't figure out how to enable amr_nb.

Step 1: Find the AMR install option for ffmpeg Homebrew package
List all install options for ffmpeg Homebrew package:
$ brew info ffmpeg
ffmpeg: stable 3.2.2 (bottled), HEAD
Play, record, convert, and stream audio and video
https://ffmpeg.org/
/usr/local/Cellar/ffmpeg/3.2.2 (239 files, 50.3M) *
Built from source on 2016-12-14 at 17:43:58 with: --with-opencore-amr
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/ffmpeg.rb
==> Dependencies
Build: pkg-config ✔, texi2html ✔, yasm ✔
Recommended: lame ✔, x264 ✔, xvid ✔
Optional: chromaprint ✘, fdk-aac ✘, fontconfig ✘, freetype ✘, frei0r ✘, game-music-emu ✘, libass ✘, libbluray ✘, libbs2b ✘, libcaca ✘, libebur128 ✘, libgsm ✘, libmodplug ✘, libsoxr ✘, libssh ✘, libvidstab ✘, libvorbis ✘, libvpx ✘, opencore-amr ✔, openh264 ✘, openjpeg ✘, openssl ✘, opus ✘, rtmpdump ✘, rubberband ✘, schroedinger ✘, sdl2 ✘, snappy ✘, speex ✘, tesseract ✘, theora ✘, two-lame ✘, wavpack ✘, webp ✘, x265 ✘, xz ✘, zeromq ✘, zimg ✘
==> Options
...
--with-opencore-amr
Enable Opencore AMR NR/WB audio format
...
More concisely:
$ brew info ffmpeg | grep amr
--with-opencore-amr
Step 2: Install ffmpeg using Homebrew install options
$ brew install ffmpeg --with-opencore-amr
Step 3: Run ffmpeg
$ ffmpeg -i audio.m4a -ar 8000 -ab 12.2k audio.amr

AMR codec support is via external libraries.
You can get OS X binaries with those libraries linked from https://evermeet.cx/ffmpeg/. Get the snapshot or nightly build.

Related

pkg-config couldn't find header of zlib

I have zlib and pkg-config installed and pkg-config could find zlib:
$ pkg-config --list-all | grep zlib
zlib zlib - zlib compression library
pkg-config --libs is working:
$ pkg-config --libs zlib
-lz
but pkg-config --cflags couldn't find header files of zlib:
$ pkg-config --cflags zlib
prints nothing
$ cat /usr/lib64/pkgconfig/zlib.pc
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/lib64
sharedlibdir=${libdir}
includedir=/usr/include
Name: zlib
Description: zlib compression library
Version: 1.2.7
Requires:
Libs: -L${libdir} -L${sharedlibdir} -lz
Cflags: -I${includedir}
Why pkg-config couldn't find zlib? (I'm using CentOS 7 if it matters)
pkg-config did find the cflags for zlib.
However, /usr/include is one of the default include paths searched by the compiler. Therefore pkg-config filters it from the output, so that the compiler won't search it twice.
For the same reason --libs produced only -lz, not including the library path -L/usr/lib64 which is also a default.

ImageMagick and PNG

I'm trying to install ImageMagick but everytime, the libpng isn't used.
When I'm running
identify -version
png does not appear in the list.
I'm retrying to install properly ImageMagick with these commands:
./configure --enable-shared
make libdir=/usr/lib64
make libdir=/usr/lib64 install
./configure --enable-shared=yes --x-libraries=/usr/lib64 --without-perl
make
make install
after in found libpng in /usr/lib64 on my system.
But after
make libdir=/usr/lib64 install
I always have this
DELEGATES = bzlib mpeg freetype jpeg lcms ps tiff x zlib
and no png is listed.
I'm still in trouble. I don't know where is my mistake.
I'm working on CentOS 6.6.
Try to add --with-modules to your configure options.
Also, inspect the output of your ./configure ... command for error and warning messages.
Most Linux distros package the runtime libraries separately from the compile-time header files. You may need to install an additional package named libpng-dev or libpng-devel to get the header files onto your system which are needed to compile ImageMagick with PNG support.

Compiling Node.js with OpenSSL support

Hi guys trying to do a remote install of Node.js, following this set of instructions here
wget http://nodejs.org/dist/node-v0.4.10.tar.gz
tar -zxvf node-v0.4.10.tar.gz
cd node-v0.x.x
./configure --prefix=~/node
make
make test
make install
this should set me up with a nodejs install under ~/node however, during the ./configure --prefix=~/node I encounter the this in the dependency requirement:
node-v0.4.10]$ ./configure --prefix=~/node
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for program gcc or cc : /usr/bin/gcc
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for gcc : ok
Checking for library dl : yes
Checking for openssl : not found
Checking for function SSL_library_init : not found
Checking for header openssl/crypto.h : not found
/opt/server/node-v0.4.10/wscript:341: error: Could not autodetect OpenSSL support. Make sure OpenSSL development packages are installed. Use configure --without-ssl to disable this message.
[tomcat#test.dev node-v0.4.10]$ make
Project not configured (run 'waf configure' first)
make: *** [program] Error 1
I have checked that open ssl is on the box:
node-v0.4.10]$ openssl version
OpenSSL 1.0.1e-fips 11 Feb 2013
~]$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-4) (GCC)
Not sure what other dependencies their are, been looking for a config file
Node.js is already packaged for the most popular distributions.
If my guess is right, and you're using CentOS 6 or similar, the following command should work fine:
sudo yum install nodejs npm --enablerepo=epel

Installing ffmpeg on amazon linux - cpp, gcc & libstdc++ dependancies

I'm fairly new to complicated config, & am trying to setup ffmpeg on an amazon linux EC2 instance, using the instruction here...
http://wiki.razuna.com/display/ecp/FFMpeg+Installation+on+CentOS+and+RedHat
... however I've hit a wall when trying the following line...
yum install glibc gcc gcc-c++ autoconf automake libtool
Here's the errors I'm getting...
Package matching glibc-2.5-107.x86_64 already installed. Checking for update.
Package matching autoconf-2.59-12.noarch already installed. Checking for update.
Package matching automake-1.9.6-2.3.el5.noarch already installed. Checking for update.
Resolving Dependencies
--> Running transaction check
---> Package gcc.x86_64 0:4.1.2-54.el5 will be installed
--> Processing Dependency: cpp = 4.1.2-54.el5 for package: gcc-4.1.2-54.el5.x86_64
Package cpp is obsoleted by cpp44, but obsoleting package does not provide for requirements
---> Package gcc-c++.x86_64 0:4.1.2-54.el5 will be installed
--> Processing Dependency: libstdc++ = 4.1.2-54.el5 for package: gcc-c++-4.1.2-54.el5.x86_64
--> Processing Dependency: libstdc++-devel = 4.1.2-54.el5 for package: gcc-c++-4.1.2-54.el5.x86_64
---> Package libtool.x86_64 0:1.5.22-7.el5_4 will be installed
--> Running transaction check
---> Package gcc.x86_64 0:4.1.2-54.el5 will be installed
--> Processing Dependency: cpp = 4.1.2-54.el5 for package: gcc-4.1.2-54.el5.x86_64
Package cpp is obsoleted by cpp44, but obsoleting package does not provide for requirements
---> Package gcc-c++.x86_64 0:4.1.2-54.el5 will be installed
--> Processing Dependency: libstdc++ = 4.1.2-54.el5 for package: gcc-c++-4.1.2-54.el5.x86_64
---> Package libstdc++-devel.x86_64 0:4.1.2-54.el5 will be installed
--> Processing Dependency: libstdc++ = 4.1.2-54.el5 for package: libstdc++-devel-4.1.2-54.el5.x86_64
--> Processing Dependency: /usr/lib64/libstdc++.so.6 for package: libstdc++-devel-4.1.2-54.el5.x86_64
--> Processing Dependency: /usr/lib64/libstdc++.so.6 for package: libstdc++-devel-4.1.2-54.el5.x86_64
--> Processing Conflict: gcc-4.6.2-1.8.amzn1.noarch conflicts libtool < 2.2.10-4.6.2
--> Processing Conflict: gcc-c++-4.6.2-1.8.amzn1.noarch conflicts libtool < 2.2.10-4.6.2
--> Finished Dependency Resolution
Error: Package: gcc-4.1.2-54.el5.x86_64 (centos)
Requires: cpp = 4.1.2-54.el5
Installed: cpp46-4.6.2-2.65.amzn1.x86_64 (#amzn-main)
cpp = 4.6.2-2.65.amzn1
Available: cpp-4.1.2-54.el5.x86_64 (centos)
cpp = 4.1.2-54.el5
cpp = 4.1.1-52.el5
Available: cpp44-4.4.6-4.77.amzn1.x86_64 (amzn-main)
cpp = 4.4.6-4.77.amzn1
Available: cpp47-4.7.0-5.68.amzn1.x86_64 (amzn-main)
cpp = 4.7.0-5.68.amzn1
Available: cpp47-4.7.2-2.69.amzn1.x86_64 (amzn-updates)
cpp = 4.7.2-2.69.amzn1
Error: Package: libstdc++-devel-4.1.2-54.el5.x86_64 (centos)
Requires: /usr/lib64/libstdc++.so.6
Available: libstdc++-4.1.2-54.el5.x86_64 (centos)
Not found
Error: gcc-c++ conflicts with libtool
Error: gcc conflicts with libtool
Error: Package: gcc-c++-4.1.2-54.el5.x86_64 (centos)
Requires: libstdc++ = 4.1.2-54.el5
Installed: libstdc++46-4.6.2-2.65.amzn1.x86_64 (#amzn-main)
libstdc++ = 4.6.2-2.65.amzn1
Installed: libstdc++47-4.7.2-2.69.amzn1.x86_64 (#amzn-updates)
libstdc++ = 4.7.2-2.69.amzn1
Available: libstdc++-4.1.2-54.el5.i386 (centos)
libstdc++ = 4.1.2-54.el5
libstdc++ = 4.1.1-52.el5
Available: libstdc++44-4.4.6-4.77.amzn1.i686 (amzn-main)
libstdc++ = 4.4.6-4.77.amzn1
Available: libstdc++47-4.7.0-5.68.amzn1.i686 (amzn-main)
libstdc++ = 4.7.0-5.68.amzn1
Error: Package: libstdc++-devel-4.1.2-54.el5.x86_64 (centos)
Requires: libstdc++ = 4.1.2-54.el5
Installed: libstdc++46-4.6.2-2.65.amzn1.x86_64 (#amzn-main)
libstdc++ = 4.6.2-2.65.amzn1
Installed: libstdc++47-4.7.2-2.69.amzn1.x86_64 (#amzn-updates)
libstdc++ = 4.7.2-2.69.amzn1
Available: libstdc++-4.1.2-54.el5.i386 (centos)
libstdc++ = 4.1.2-54.el5
libstdc++ = 4.1.1-52.el5
Available: libstdc++44-4.4.6-4.77.amzn1.i686 (amzn-main)
libstdc++ = 4.4.6-4.77.amzn1
Available: libstdc++47-4.7.0-5.68.amzn1.i686 (amzn-main)
libstdc++ = 4.7.0-5.68.amzn1
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
Here is how to install FFMPEG on Linux using a static build.
A good FAQ is here: https://www.johnvansickle.com/ffmpeg/faq/
SSH into your instance and become root
sudo su -
Go to the the /usr/local/bin directory
cd /usr/local/bin
Inside the /usr/local/bin directory, create an "ffmpeg" directory
mkdir ffmpeg
Go into the new directory
cd ffmpeg
Now, open a browser and go to the list of FFMPEG static builds at https://johnvansickle.com/ffmpeg/ and pick the latest version.
While inside the /usr/local/bin/ffmpeg directory, type the following command to download the static build you have selected
wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz
Now, untar it...
tar -xzf ffmpeg-git-amd64-static.tar.xz
Run it and check what the latest version is
./ffmpeg -version
The output should look something like this
ffmpeg version N-60675-g8fe1076
built on Feb 16 2014 05:45:47 with gcc 4.6 (Debian 4.6.3-1)
configuration: --prefix=/root/ffmpeg-static/64bit --extra-cflags='-I/root/ffmpeg-
static/64bit/include -static' --extra-ldflags='-L/root/ffmpeg-static/64bit/lib -static' --
extra-libs='-lxml2 -lexpat -lfreetype' --enable-static --disable-shared --disable-ffserver --
disable-doc --enable-bzlib --enable-zlib --enable-postproc --enable-runtime-cpudetect --
enable-libx264 --enable-gpl --enable-libtheora --enable-libvorbis --enable-libmp3lame --
enable-gray --enable-libass --enable-libfreetype --enable-libopenjpeg --enable-libspeex --
enable-libvo-aacenc --enable-libvo-amrwbenc --enable-version3 --enable-libvpx
libavutil 52. 64.100 / 52. 64.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 32.101 / 55. 32.101
libavdevice 55. 9.101 / 55. 9.101
libavfilter 4. 1.102 / 4. 1.102
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 17.104 / 0. 17.104
libpostproc 52. 3.100 / 52. 3.100
If you want to be able to execute FFMPEG from any directory, simply create a symlink into /usr/bin like this:
ln -s /usr/local/bin/ffmpeg/ffmpeg /usr/bin/ffmpeg
The first part (/usr/local/bin/ffmpeg/ffmpeg) is where the file is located after I untarred
the file. The second part (/usr/bin/ffmpeg) is where we want the symlink to go
Now, you should be able to run the command "ffmpeg" from anywhere
The answer from Marc works good for me.
To use the FFProbe (ffprobe gathers information from multimedia streams and prints it in human and machine-readable format), you can add the simlink to it too:
ln -snf /usr/local/bin/ffmpeg/ffprobe /usr/bin/ffprobe
You could just download the static builds from http://ffmpeg.gusari.org/static/64bit. It works on 64-bit Amzn Linux with no problem.

How to install X264

I'm trying to make a program. When I run ./configure, this is what I get:
checking for X264... configure: WARNING:
Test application not built (x264 codec missing).
Either you have not installed x264, or you
have not installed it with the Gtk+ interface.
If you compile it from source, add these options
to configure:
--enable-shared
--enable-gtk
I have installed various packages that are related to x264 and gtk, but I'm still getting this message. Which packages do I need to install?
I used this howto to install ffmpeg and x264 on my machine...

Resources