无法在centos 7上安装libvorbis,致命错误:ogg / ogg.h:没有这样的文件或目录

时间:2019-10-13 21:58:05

标签: ffmpeg centos7

您好,我一直在尝试使用本教程使用某些库安装FFmpeg https://trac.ffmpeg.org/wiki/CompilationGuide/Centos?version=85

使用此命令安装libvorbis

import pygame,sys
from pygame.locals import *
from random import randint

pygame.init()
ventana=pygame.display.set_mode((1200,600))
pygame.display.set_caption("Jueguiño")

imageVida= pygame.image.load("vida.jpg")
posX= randint(0,1200)
posY= randint(0,0)

rectangulo=pygame.Rect(0,0,100,50)


velocidad=0.5

Blanco=(255,255,255)

while True:
    ventana.fill(Blanco)
    ventana.blit(imageVida,(posX,posY))
    pygame.draw.rect(ventana,(180,70,70),rectangulo)

    rectangulo.left,rectangulo.top=pygame.mouse.get_pos()
    if rectangulo.colliderect(imageVida):
        velocidad=0
    for event in pygame.event.get():
        if event.type == QUIT:
            pygame.quit()
            sys.exit()

    if posY<1200:
        posY+=velocidad
    pygame.display.update()

我通过make命令得到此错误

cd ~/ffmpeg_sources
curl -O -L http://downloads.xiph.org/releases/vorbis/libvorbis-1.3.5.tar.gz
tar xzvf libvorbis-1.3.5.tar.gz
cd libvorbis-1.3.5
./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-shared
make
make install

当我安装ffmpeg时,出现此错误

    ../include/vorbis/codec.h:26:21: fatal error: ogg/ogg.h: No such file or directory
     #include <ogg/ogg.h>
compilation terminated.

谢谢

1 个答案:

答案 0 :(得分:0)

libvorbis需要libogg。您遵循的指南中提到了这一点。因此,首先编译libogg:

cd ~/ffmpeg_sources
curl -O -L https://downloads.xiph.org/releases/ogg/libogg-1.3.4.tar.gz
tar xzvf libogg-1.3.4.tar.gz
cd libogg-1.3.4
./configure --prefix="$HOME/ffmpeg_build" --disable-shared
make
make install

然后编译libvorbis:

cd ~/ffmpeg_sources
curl -O -L https://downloads.xiph.org/releases/vorbis/libvorbis-1.3.6.tar.gz
tar xzvf libvorbis-1.3.6.tar.gz
cd libvorbis-1.3.6
./configure --prefix="$HOME/ffmpeg_build" --with-ogg="$HOME/ffmpeg_build" --disable-shared
make
make install

请注意,libogg当前的版本为1.3.4,而libvorbis的版本为1.3.6。您正在遵循该指南的旧版本,因此您尝试安装libvorbis 1.3.5。