iis服务器助手广告广告
返回顶部
首页 > 资讯 > 后端开发 > Python >macos安装ffmpeg以及出现问题
  • 692
分享到

macos安装ffmpeg以及出现问题

macosffmpeg 2023-01-31 07:01:00 692人浏览 薄情痞子

Python 官方文档:入门教程 => 点击学习

摘要

安装FFmpeg使用brew首先安装brew: /usr/bin/ruby -e "$(curl -fsSL https://raw.GitHubusercontent.com/Homebrew/install/master/instal

安装FFmpeg使用brew
首先安装brew:

/usr/bin/ruby -e "$(curl -fsSL https://raw.GitHubusercontent.com/Homebrew/install/master/install)"

出现这个:==> Installation successful!安装成功

....

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

看看相关命令

$ 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...]

Further help:
  brew commands
  brew help [COMMAND]
  man brew
  https://docs.brew.sh

安装ffmpeg,使用brew安装:

$ brew install  ffmpeg 
==> Installing dependencies for ffmpeg: 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 from https://akamai.bintray.com/a5/a509ee11dc4a3cd431a888c708d32c53D81e5ca67250520f91284d4370d946d4?__gda__=exp=1563528408~hMac=dd80d6bc9693a885841309c5bc094e71743
######################################################################## 100.0%
==> Pouring frei0r-1.6.1.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.mojave.bottle.tar.gz
?  /usr/local/Cellar/libtasn1/4.13: 59 files, 436KB
==> Installing ffmpeg dependency: nettle

出现下面的表名正在下载安装ffmpeg:注意安装目录

==> 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~hmac=8eb115e7fc1a65ade91bdda74c9fd572e38
######################################################################## 100.0%
==> Pouring ffmpeg-4.1.4_1.mojave.bottle.tar.gz
?  /usr/local/Cellar/ffmpeg/4.1.4_1: 282 files, 55.0MB

一切安装顺利,然鹅。。。。然鹅,执行ffmpeg命名报错了
出现下面的错误:

$ 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

报错:

dyld: Library not loaded:
/usr/local/opt/freetype/lib/libfreetype.6.dylib

就是freetype动态库指定的目录不存在,或许没有安装,使用brew命令安装,显示已经安装,重新卸载安装也不行
但是安装完成之后也不行,一直报错
执行命令报错:

$ 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

进入ffmpeg安装目录,查看是否是因为路径问题

$ cd /usr/local/Cellar/ffmpeg/4.1.4_1/bin
$ ./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

发现还是报错。于是还是从查看ffmepg的动态库freetype入手,看看相关的功能。

查看目录中是否有相关的目录

$ 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
autoconf@2.69         giflib                libass                libsndfile            mongo                 openexr               sdl2                  wget
boost                 glib                  libbluray             libsodium             mongoDB               openjpeg              shared-mime-info      x264
boost@1.69            gmp                   libde265              libsoxr               mongodb-commUnity     openldap              snappy                x265
bower                 gnutls                libev                 libssh2               mongodb-community@4.0 openssl               speex                 xvid
brotli                graphite2             libevent              libtasn               mongodb@4.0           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                PHP@7.2               theora
ffmpeg@4              imagemagick           libjpg                libuv                 nghttp2               pixman                thrift
flac                  imagemagick@7         libmetalink           libvorbis             node                  proxychains-ng        thrift@0.12

可以看到并不存在,同时发现新安装的freetype目录在其他位置,通过建立软连接解决问题。

通过先卸载后安装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... (61 files, 2.2MB)

# 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/4e8dc5929a6cd94508b9908d8d04d326817a99cd66c009056b2fe3a60d182bd1--freetype-2.10.1.mojave.bottle.tar.gz
==> Pouring freetype-2.10.1.mojave.bottle.tar.gz
?  /usr/local/Cellar/freetype/2.10.1: 61 files, 2.2MB

# 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

执行之后,查看文件已存在,同时执行ffmpeg,发现已经可以正常使用。

$ 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.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  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 full help or, even bet

来个视频试试

$ 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.  0 /  4.  0.  0
  libswscale      5.  3.100 /  5.  3.100
  libswresample   3.  3.100 /  3.  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

目前ffmpeg使用一切顺利,然鹅其他软件又出现了问题php报错。。。欲解决问题,请看我的下篇文章【php执行失败动态库libicui18n报错】

--结束END--

本文标题: macos安装ffmpeg以及出现问题

本文链接: http://www.lsjlt.com/news/192194.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • macos安装ffmpeg以及出现问题
    安装ffmpeg使用brew首先安装brew: /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/instal...
    99+
    2023-01-31
    macos ffmpeg
  • MYSQL本地安装以及出现的问题解决
    前言 本文写得还是比较详细,甚至有些繁琐,有很多步骤在其他的教程文档里都是省略掉的,但是我还是要写出来,因为我当时走了很多弯路,我希望你们能够避免我走的这些弯路。当然,知道同学的可以略过,选择你想知道的地方...
    99+
    2024-04-02
  • ffmpeg的安装以及使用的方法
    这篇文章主要介绍“ffmpeg的安装以及使用的方法”,在日常操作中,相信很多人在ffmpeg的安装以及使用的方法问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”ffmpeg的安...
    99+
    2024-04-02
  • 搭建虚拟机Macos及安装XCode(问题解决)
    前言:安装Mac虚拟机的过程中遇到了一系列的问题,接下来将按照安装流程阐述每个步骤中所遇难题及相应的解决方法(电脑系统是Win11)。 1.下载安装所需文件,安装并解锁unlocker 首先按照教程技能 | Win10系统安装苹果Mac虚拟...
    99+
    2023-10-05
    macos
  • Rstudio中安装package出现的问题及解决
    Rstudio中安装package问题 一、 install.packages('REmap')无法安装package:错误:“无法与服务器建立连接” 解决方式:切换下载的镜像 方法...
    99+
    2024-04-02
  • Linux安装Python3.11以及解决openssl问题
    Linux系统安装Python3 Linux系统:centos7 python版本:3.11 1、查看系统自带python 默认情况下,Linux会自带安装Python,可以运行pytho...
    99+
    2023-09-07
    linux python3.11 python
  • vue+vux vux安装出现错误问题及解决
    目录搭建vux项目首先搭建vue项目安装vux最后启动项目 npm run dev || cnpm run devvux安装中遇到的坑搭建vux项目 介绍:VUX是基于WeUI和Vu...
    99+
    2024-04-02
  • 安装scrapy,以及出现的错误解决。
    首先我是在python3的环境上面完成的。我保留了python2的版本,然后安装python3的版本。然后在安装scrapy的过程中出现的错误,以及切换python版本后出现的错误。一、安装python3 cd /usr/local/src...
    99+
    2023-01-31
    错误 scrapy
  • flutter 安装配置出现的问题
    观看视频:P17 Flutter Windows Android环境搭建 真机调试 安装之后,在命令行工具中输入 flutter doctor,报错 1. cmdline-tools component is missing 在SDK m...
    99+
    2023-08-17
    flutter android
  • mysql 8.0.18各版本安装及安装中出现的问题(精华总结)
    精华总结:MYSQL出现的问题解决记录: 不管通过什么方式安装(rpm或者gz或者gz.xz),安装顺序一定要对, 先在/etc/my.cfg文件先配置好,没有先创建这个文件,尽管放心,因为mysql启动...
    99+
    2024-04-02
  • mysql数据库在Linux操作系统上的安装以及容易出现的问题
    这篇文章主要讲解了“mysql数据库在Linux操作系统上的安装以及容易出现的问题”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“mysql数据库在Linux...
    99+
    2024-04-02
  • vue脚手架安装以及安装失败问题解决办法
    目录前言一、脚手架的命令安装1.1 命令查看版本信息1.2 通过键入命令安装脚手架二、node.js环境安装附:vue安装vue脚手架(vue-cli)错误总结总结前言 在不少小伙伴...
    99+
    2024-04-02
  • windows下scrapy安装问题,以
    方法1(通常是失败的) 1. 命令行执行: pip3 install scrapy 不管是网络问题也好,缺少相关的包也好,用这条命令安装scrapy我就没成功过。。。难受 方法2(成功) 手动安装相关的包。 1. lxml安装命令(没...
    99+
    2023-01-30
    windows scrapy
  • Maven nexus安装nexus私服出现的问题及解决办法
    本篇内容主要讲解“Maven nexus安装nexus私服出现的问题及解决办法”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Maven nexus安装nexus...
    99+
    2024-04-02
  • 安装vCenter6.0遇到的问题以及解决方法
    实验环境: 在Window Server 2008 R2上安装vCenter6.0,数据库采用的SQL Server2012   问题一: 安装到50%的时候提示:无法启动invsvc服务以及无法运行vdcpromo等各种问题,点...
    99+
    2023-06-04
  • IDEA 2020.1 for Mac 下载安装配置及出现的问题小结
    目录下载安装激活教程配置出现的问题下载安装 IDEA 2020.1 添加了对 Java 14 的支持以及适用于各种框架的新功能,通过数据流分析辅助升级了调试器,新增了 LightEd...
    99+
    2024-04-02
  • mysql安装出现bus error问题怎么办
    这篇文章主要介绍mysql安装出现bus error问题怎么办,文中介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们一定要看完!mysql安装bus error的解决办法:1、对于Redhat系列来说,...
    99+
    2024-04-02
  • 怎么解决安装mysql出现this问题
    小编给大家分享一下怎么解决安装mysql出现this问题,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧! ...
    99+
    2024-04-02
  • Pytorch中torchtext终极安装方法以及常见问题
    目录1.简介2.先说成功安装的方法3.常见的其他安装方式3.1 直接使用pip install torchtext安装3.2 使用conda install -c pytorch t...
    99+
    2023-05-20
    pytorch torchtext安装 pytorch torchtext
  • Charles安装以及解决运行没反应的问题
    一、安装 Charles需要收费 2、下载地址:https://www.charlesproxy.com/latest-release/download.do 我下载的4.6.4版本 正常安装即可 安...
    99+
    2023-10-25
    ssl https 服务器
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作