SSブログ

各種コーディックのインストール - Theora編 - [FreeBSD]

ライブラリtheora
公式ページhttp://www.theora.org/

theoraは、Oggコンテナフォーマットの標準ビデオコーディックてして利用されるものです。
あまり利用する機会は無いような気がしますが、とりあえずインストールしておきます。
portsでは、バージョンが1.0だったので、最新バージョン1.1.1を公式ページより
取得してソースよりコンパイルします。

●準備
公式ページよりアーカイブを取得し、解凍します。
> fetch http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
> bzip2 -d libtheora-1.1.1.tar.bz2
> tar zxvf libtheora-1.1.1.tar

●./configure
解凍したディレクトリに移動し、./configureでコンパイルオプションを指定します。
./configure --helpでオプションを確認しても特に指定するオプションが無かったため、
オプションなしで実行します。
> cd libtheora-1.1.1
> ./configure

sdl-config が無いと怒られたので、portsよりインストールします。

アプリportsの場所
sdl-config/usr/ports/devel/sdl12

オプションを聞かれるので、デフォルトにします。
> cd /usr/ports/devel/sdl12
> su
# make
# make install
# make clean

再度、libtheoraを解凍したディレクトリに戻って、./configureを実行します。
> cd libtheora-1.1.1
> ./configure



------------------------------------------------------------------------
libtheora 1.1.1: Automatic configuration OK.

General configuration:

Encoding support: ........... yes
Floating point support: ..... yes
Assembly optimization: ...... no optimization for your platform, please send a patch
Debugging telemetry: ........ no
Build example code: ......... yes
API Documentation: .......... no
Format Documentation: ....... no

Installation paths:

libtheora: ................... /usr/local/lib
C header files: .............. /usr/local/include/theora
Documentation: ............... /usr/local/share/doc/libtheora

Building:

Type 'make' to compile libtheora.

Type 'make install' to install libtheora.

Type 'make check' to run test suite (Valgrind testing not enabled)

Example programs will be built but not installed.
------------------------------------------------------------------------

特に問題なく終了しました。
●コンパイル
メッセージどおりコンパイルします。
> make



source='dump_video.c' object='dump_video.o' libtool=no depfile='.deps/dump_video.Po' tmpdepfile='.deps/dump_video.TPo' depmode=gcc3 /bin/sh ../depcomp gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I/usr/local/include -Wall -Wno-parentheses -O3 -fforce-addr -fomit-frame-pointer -finline-functions -funroll-loops -c `test -f 'dump_video.c' || echo './'`dump_video.c
In file included from dump_video.c:43:
/usr/include/sys/timeb.h:43: error: expected specifier-qualifier-list before 'time_t'
dump_video.c: In function 'main':
dump_video.c:448: error: 'struct timeb' has no member named 'time'
dump_video.c:448: error: 'struct timeb' has no member named 'millitm'
dump_video.c:449: error: 'struct timeb' has no member named 'time'
dump_video.c:449: error: 'struct timeb' has no member named 'millitm'
dump_video.c:456: error: 'struct timeb' has no member named 'time'
dump_video.c:456: error: 'struct timeb' has no member named 'millitm'
dump_video.c:457: error: 'struct timeb' has no member named 'time'
dump_video.c:457: error: 'struct timeb' has no member named 'millitm'
*** Error code 1

Stop in /usr/local/home/hideki/build.d/libtheora-1.1.1/examples.
*** Error code 1

Stop in /usr/local/home/hideki/build.d/libtheora-1.1.1.
*** Error code 1

Stop in /usr/local/home/hideki/build.d/libtheora-1.1.1.

うーん、エラー発生です。timeb.hで使用されているtime_tが定義されていない為、エラーとなっているようです。
time_tは、/usr/include/time.hに定義されていますが、exsamples/dump_video.cには、インクルードされていないようです。
#include の前に、#include を追加します。
> vi exsamples/dump_video.c



#include
#include
#include <--- これを追加
#include
#include




再度make
> make



source='player_example.c' object='player_example-player_example.o' libtool=no depfile='.deps/player_example-player_example.Po' tmpdepfile='.deps/player_example-player_example.TPo' depmode=gcc3 /bin/sh ../depcomp gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../include -I/usr/local/include/SDL -I/usr/local/include -D_GNU_SOURCE=1 -D_REENTRANT -I/usr/local/include -I/usr/local/include -Wall -Wno-parentheses -O3 -fforce-addr -fomit-frame-pointer -finline-functions -funroll-loops -c -o player_example-player_example.o `test -f 'player_example.c' || echo './'`player_example.c
player_example.c:68:31: error: machine/soundcard.h: No such file or directory
player_example.c: In function 'open_audio':
player_example.c:166: error: 'audio_buf_info' undeclared (first use in this function)
player_example.c:166: error: (Each undeclared identifier is reported only once
player_example.c:166: error: for each function it appears in.)
player_example.c:166: error: expected ';' before 'info'
player_example.c:167: error: 'AFMT_S16_NE' undeclared (first use in this function)
player_example.c:178: error: 'SNDCTL_DSP_SETFMT' undeclared (first use in this function)
player_example.c:184: error: 'SNDCTL_DSP_CHANNELS' undeclared (first use in this function)
player_example.c:190: error: 'SNDCTL_DSP_SPEED' undeclared (first use in this function)
player_example.c:196: error: 'SNDCTL_DSP_GETOSPACE' undeclared (first use in this function)
player_example.c:196: error: 'info' undeclared (first use in this function)
player_example.c: In function 'audio_close':
player_example.c:205: error: 'SNDCTL_DSP_RESET' undeclared (first use in this function)
player_example.c: In function 'audio_write_nonblocking':
player_example.c:275: error: 'audio_buf_info' undeclared (first use in this function)
player_example.c:275: error: expected ';' before 'info'
player_example.c:278: error: 'SNDCTL_DSP_GETOSPACE' undeclared (first use in this function)
player_example.c:278: error: 'info' undeclared (first use in this function)
*** Error code 1

Stop in /usr/local/home/hideki/build.d/libtheora-1.1.1/examples.
*** Error code 1

Stop in /usr/local/home/hideki/build.d/libtheora-1.1.1.
*** Error code 1

Stop in /usr/local/home/hideki/build.d/libtheora-1.1.1.
また、エラー。 今度は、machine/soundcard.hが無いと怒られました。 examples/player_example.c を見てみると、以下のように、FreeBSD用にインクルードされています。
> cat examples/player_example.c



#if defined(__FreeBSD__)
#include
#define AUDIO_DEVICE "/dev/audio"
#elif defined(__NetBSD__) || defined(__OpenBSD__)



ここで、インクルードされているmachine/soundcard.hは、 FreeBSD 8.0では、sys/soundcard.h に存在しているので、 書き換えます。
> vi examples/player_example.c



#if defined(__FreeBSD__)
#include <-- ここを書き換え
#define AUDIO_DEVICE "/dev/audio"
#elif defined(__NetBSD__) || defined(__OpenBSD__)



再度 makeするとコンパイルが通ったので、make installでインストールします。
> make
> make install
テストスクリプトもあるようなので、実行します。
> make check



PASS: granulepos_theoraenc
---- + Checking granulepos generation ...
---- + Checking granulepos generation ...
---- + Checking granulepos generation ...
---- + Checking granulepos generation ...
---- + Checking granulepos generation ...
---- + Checking granulepos generation ...
PASS: granulepos_theora
==================
All 9 tests passed
==================
Making check in m4
Making check in examples
すべてのテストは、無事成功しました。 それにしても、素直にソースからコンパイルできるものは、なかなか無いものですね。

nice!(0)  コメント(0)  トラックバック(0) 
共通テーマ:パソコン・インターネット

nice! 0

コメント 0

コメントを書く

お名前:
URL:
コメント:
画像認証:
下の画像に表示されている文字を入力してください。

トラックバック 0

この広告は前回の更新から一定期間経過したブログに表示されています。更新すると自動で解除されます。