First install brew:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Copy the code
==> Installation successful! Successful installation
. No changes to formulae. ==> Installation successful! ==> Homebrew has enabled anonymous aggregate formulae and cask analytics. Read the analytics documentation (and how to opt-out) here: https://docs.brew.sh/Analytics ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: https://github.com/Homebrew/brew#donations
==> Next steps:
- Run `brew help` to get started
- Further documentation:
https://docs.brew.sh
Copy the code
Look at the commands
$ brew Example usage: brew search [TEXT|/REGEX/] brew info [FORMULA...] brew install FORMULA... brew update brew upgrade [FORMULA...] brew uninstall FORMULA... brew list [FORMULA...] Troubleshooting: brew config brew doctor brew install --verbose --debug FORMULA Contributing: brew create [URL [--no-fetch]] brew edit [FORMULA...] Furtherhelp:
brew commands
brew help [COMMAND]
man brew
https://docs.brew.sh
Copy the code
Install FFMPEG using BREW:
$ brew install ffmpeg
==> Installing dependencies forffmpeg: frei0r, libtasn1, nettle, p11-kit, openssl, libevent, unbound, gnutls, lame, fribidi, gettext, python, glib, lzo, pixman, cairo, graphite2, icu4c, harfbuzz, libass, libbluray, libsoxr, libogg, libvorbis, libvpx, opencore-amr, opus, flac, libsndfile, libsamplerate, rubberband, sdl2, snappy, speex, webp, theora, x264, x265 and xvid ==> Installing ffmpeg dependency: Frei0r = = > Downloading https://homebrew.bintray.com/bottles/frei0r-1.6.1.mojave.bottle.1.tar.gz = = > Downloading the from https://akamai.bintray.com/a5/a509ee11dc4a3cd431a888c708d32c53d81e5ca67250520f91284d4370d946d4? __gda__=exp=1563528408~hmac=dd80d6bc9693a885841309c5bc094e71743# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # (100.0%)= = > Pouring frei0r - 1.6.1. The mojave. Bottle. 1. Tar. Gz 🍺 / usr /local/Cellar/frei0r/ 1.6.1:137 files, 2.0MB ==> Installing FFmPEG Dependency: Libtasn1 = = > Downloading https://homebrew.bintray.com/bottles/libtasn1-4.13.mojave.bottle.tar.gz# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # (100.0%)= = > Pouring libtasn1-4.13. The mojave. Bottle. Tar. Gz 🍺 / usr /local/Cellar/libtasn1/4.13: 59 files, 436KB
==> Installing ffmpeg dependency: nettle
Copy the code
The following table name appears to be downloading the installation of FFMPEG: note the installation directory
= = > Installing ffmpeg = = > Downloading https://homebrew.bintray.com/bottles/ffmpeg-4.1.4_1.mojave.bottle.tar.gz = = > Downloading from https://akamai.bintray.com/1f/1fff696effdf5cdea3feb1b2d022018c6dfe47b71de640a46adc4631cdeccf1e?__gda__=exp=1563528747~hm ac=8eb115e7fc1a65ade91bdda74c9fd572e38
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # (100.0%)Pouring ffmPEG-4.1.4_1.mojav.bottle.tar. gz 🍺 /usr/local/ Cellar/ffmpeg / 4.1.4 _1:282 files, 55.0 MBCopy the code
Everything went well, but goose… Error: ffmpeg name error:
$ ffmpeg
dyld: Library not loaded: /usr/local/opt/freetype/lib/libfreetype.6.dylib
Referenced from: /usr/local/bin/ffmpeg
Reason: image not found
[1] 22518 abort ffmpeg
Copy the code
Error:
dyld: Library not loaded:
/usr/local/opt/freetype/lib/libfreetype.6.dylib
Copy the code
The freetype dynamic library does not exist in the specified directory. The freetype dynamic library does not exist in the specified directory.
$ ffmpeg
dyld: Library not loaded: /usr/local/opt/freetype/lib/libfreetype.6.dylib
Referenced from: /usr/local/bin/ffmpeg
Reason: image not found
[1] 22518 abort ffmpeg
Copy the code
Go to the FFmpeg installation directory and check whether the path is faulty
$ cd /usr/local/Cellar/ffmpeg/4.1.4_1/bin $./ffmpeg dyld: /usr/local/opt/freetype/lib/libfreetype.6.dylib
Referenced from: /usr/local/bin/ffmpeg
Reason: image not found
[1] 22518 abort ffmpeg
Copy the code
Error still reported on discovery. So start by looking at ffMEPG’s dynamic library, Freetype, to see the related functions.
Check whether there are related directories in the directory
$ cd /usr/local/opt/freetype/lib/
cd: no such file or directory: /usr/local/opt/freetype/lib/
$ cd /usr/local/opt/ $ ls aom fontconfig jansson libnettle libvpx node.js python tidy-html5 apr freetds jemalloc libogg libvterm node@11 python3 tree apr-util frei0r jpeg libomp libzip nodejs python@2 unbound argon2 fribidi lame libpng little-cms2 npm readline unibilium aspell gdbm lcms2 libpq luajit nvim rtmpdump unixodbc autoconf gettext leptonica libsamplerate Lzo Opencore - Amr Rubberband webp [email protected] giflib libass libsndfile Mongo OpenExr sdL2 wget Boost glib libbluray Libsodium mongodb openjpeg shared-mime-info x264 [email protected] GMP libde265 libsoxr mongodb-community openldap snappy X265 Bower gnutls libev libssh2 [email protected] Openssl speex xvid Brotli Graphite2 libevent libtasn [email protected] opus sqlite xz c-ares harfbuzz libffi libtasn1 msgpack p11-kit sqlite3 yarn cairo htop libheif libtermkey ncurses pcre tcpdump curl htop-osx libidn libtiff neovim pcre1 telnet curl-openssl icu4c libidn2 libtool netcat pcre2 tesseract Ffmpeg ilmbase libjpeg libunistring nettle [email protected] theora ffmpeg@4 imagemagick libjpg libuv nghttp2 pixman Thrift Flac imagemagick@7 libmetalink libvorbis node ProxyChains -ng [email protected]Copy the code
You can see that the freetype directory does not exist, and you can find that the newly installed freetype directory is in another location.
Determine the installation directory by uninstalling and then installing Freetype
$brew upgrade Freetype Error: Freetype 2.10.1 already installed# yanglei @ yangleideMacBook-Pro in /usr/local/opt [17:33:50] C:1
$ brew uninstall freetype
Uninstalling /usr/local/ Cellar/freetype / 2.10.1... (2.2 MB) 61 files,# yanglei @ yangleideMacBook-Pro in /usr/local/opt [17:34:11] $brew install freetype = = > Downloading https://homebrew.bintray.com/bottles/freetype-2.10.1.mojave.bottle.tar.gz Already downloaded: /Users/yanglei/Library/Caches/Homebrew/downloads/4e8dc5929a6cd94508b9908d8d04d326817a99cd66 c009056b2fe3a60d182bd1 - freetype - 2.10.1. The mojave. Bottle. Tar. Gz = = > Pouring freetype - 2.10.1. Mojave. Bottle. Tar. Gz 🍺 / usr /local/ Cellar/freetype / 2.10.1:61 files, 2.2 MB# yanglei @ yangleideMacBook-Pro in /usr/local/opt [17:34:39]
$ cd /usr/local/opt/freetype/lib/libfreetype.6.dylib
cd: not a directory: /usr/local/opt/freetype/lib/libfreetype.6.dylib
cd /usr/local/ Cellar/freetype / 2.10.1 / $ln-s /usr/local/ Cellar/freetype / 2.10.1 / bin/freetype - config/usr /local/opt/freetype/lib/libfreetype.6.dylib
ln: /usr/local/opt/freetype/lib/libfreetype.6.dylib: File exists
# yanglei @ yangleideMacBook - Pro in/usr/local/Cellar/freetype 2.10.1 / bin [17:36:55] C: 1
$ cd /usr/local/opt/freetype/lib/
# yanglei @ yangleideMacBook-Pro in /usr/local/opt/freetype/lib [17:37:11]
$ ls
libfreetype.6.dylib libfreetype.a libfreetype.dylib pkgconfig
# yanglei @ yangleideMacBook-Pro in /usr/local/opt/freetype/lib [17:37:12]
$ l
total 2744
drwxr-xr-x 6 yanglei staff 192B Jul 1 23:55 .
drwxr-xr-x 10 yanglei staff 320B Jul 19 17:34 ..
-r--r--r-- 1 yanglei staff 591K Jul 19 17:34 libfreetype.6.dylib
-r--r--r-- 1 yanglei staff 780K Jul 1 23:55 libfreetype.a
lrwxr-xr-x 1 yanglei staff 19B Jul 1 23:55 libfreetype.dylib -> libfreetype.6.dylib
drwxr-xr-x 3 yanglei staff 96B Jul 19 17:34 pkgconfig
Copy the code
After executing ffmPEG, check that the file already exists and execute ffmPEG at the same time.
$FFMPEG FFMPEG Version 4.1.4 Copyright (C) 2000-2019 The FFMPEG developers built with Apple LLVM Version 10.0.1 (clang - 1001.0.46.4) configuration: -- prefix = / usr /local/Cellar/ffmpeg/4.1.4_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-i/Library/Java/JavaVirtualMachines adoptopenjdk - 12.0.1. JDK/Contents/Home/include - I/Library/Java/JavaVirtualMachines adoptopenjdk - 12.0.1. JDK/Contents/Home/include/Darwin '--host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr libavutil 56.22.100/56.22.100 libavcodec 58.35.100/58.35.100 libavformat 58. 20.100/58.20.100 libavDevice 58.5.100/58.5.100 libavFilter 7.40.101/7.40.101 libavresample 4.0/4.0 Libswscale 5.3.100/5.3.100 libswresample 3.3.100/3.100 libPostProc 55.3.100/55.3.100 Hyper Fast Audio and Video encoder usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}... Use -h to get fullhelp or, even bet
Copy the code
Let’s try a video
$FFMPEG -I bb.mp4 FFMPEG Version 4.1.4 Copyright (C) 2000-2019 The FFMPEG developers built with Apple LLVM Version 10.0.1 (clang - 1001.0.46.4) configuration: -- prefix = / usr /local/Cellar/ffmpeg/4.1.4_1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags='-i/Library/Java/JavaVirtualMachines adoptopenjdk - 12.0.1. JDK/Contents/Home/include - I/Library/Java/JavaVirtualMachines adoptopenjdk - 12.0.1. JDK/Contents/Home/include/Darwin '--host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libmp3lame --enable-libopus --enable-librubberband --enable-libsnappy --enable-libtesseract --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-videotoolbox --disable-libjack --disable-indev=jack --enable-libaom --enable-libsoxr libavutil 56.22.100/56.22.100 libavcodec 58.35.100/58.35.100 libavformat 58. 20.100/58.20.100 libavDevice 58.5.100/58.5.100 libavFilter 7.40.101/7.40.101 libavresample 4.0/4.0 Libswscale 5.3.100/5.3.100 libswresample 3.3.100/3.100 libpostProc 55.3.100/55.3.100 Input#0, mov,mp4,m4a,3gp,3g2,mj2, from 'bb.mp4':Metadata: major_brand: isom minor_version: 512 compatible_brands: isomiso2AVc1mp41 encoder: Lavf56.25.101 Duration: 00:00:11.24, start: 0.000000, bitrate: 1182 KB /s Stream#0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 1:1 DAR 16:9], 1180 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
Metadata:
handler_name : VideoHandler
Copy the code
So far ffMPEG is going well, but other software has appeared in PHP… PHP dynamic library libicui18n fails to execute