LoginSignup
8
9

More than 5 years have passed since last update.

AmazonLinuxにffmpegをインストールする

Posted at

AWS-EC2のAmazonLinuxにffmpegをインストールしようと思い、つまずいたところがあったので書き残し。

基本的な手順

基本的には公式のCentOS向けの手順を使う。
https://trac.ffmpeg.org/wiki/CompilationGuide/Centos

つまずいたところ

libx264のインストール途中、./configureでmakefileを作成する時に「nasmのバージョンが低いよ」という旨のエラーが出た。

Found no assembler
Minimum version is nasm-2.13
If you really want to compile without asm, configure with --disable-asm.

nasm -vしてみると、NASM version 2.10.07みたいな感じで、たしかにバージョンが足りてない。
公式向け手順の最初でnasmのrepoを追加した後にyum installしているので、なんでバージョン低いやつが入ってるんだ?となった。

解決

結論としては、yum installの時にnasmのrepoが参照されておらず、Amazonのrepo(nasmのバージョンが古い)を参照してインストールが走っていたので、最新バージョンが入っていなかった。

調べてみると、AmazonLinuxは初期設定でAmazonのrepoを優先的に参照する設定になっているらしい。
(参照:http://dev.classmethod.jp/server-side/os/amazonlinux-yum-priority/)

解決方法もこの記事に書いてある通りで、/etc/yum.repos.d/amzn-main.repoを編集して、AmazonのrepoのPriorityを99(デフォルト)にしてあげる。
これでnasmのrepoとAmazonのrepoの優先度が同じになるので、あとは普通にyum install nasmでOK。

8
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
8
9