プログラミング-ffmpeg導入・足掻き編-

Mingw・MSYSの環境に導入する前にもう少しCygwinで足掻いてみた。

  • 導入に用いたsvn, configureのオプションなどは以下の通り。

$ ffmpeg
FFmpeg version SVN-r19673, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --disable-shared --enable-static --enable-gpl
libavutil 50. 3. 0 / 50. 3. 0
libavcodec 52.32. 0 / 52.32. 0
libavformat 52.37. 0 / 52.37. 0
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0. 7. 1 / 0. 7. 1
built on Aug 21 2009 17:44:12, gcc: 3.4.4 (cygming special, gdc 0.12, using dm
d 0.125)
At least one output file must be specified

ちなみに, Cygwinのバージョンは以下の通り。

$ uname -r
1.5.25(0.156/4/2)

http://ffmpeg.org/general.htmlによれば
llrint()の関係でバージョンは1.7を使うようにとあるが, 前回waringですんだため無視することにした。(シェルでffmpegが使えたし。。)

  • サンプルプログラムのmakefileは前回と同じ。

CC = gcc
CFLAGS = -Wall -I/usr/local/include
LDFLAGS = -L/usr/local/bin
LDLIBS = -lavutil -lavformat -lavcodec -lswscale -lavdevice
OBJS = make_thumb.o
make_thumb: $(OBJS)
$(CC) -o $@ $(LDFLAGS) $(OBJS) $(LDLIBS)

  • 上手くmakeできなかったため無理やり, makeに必要だと思われるファイルを同じディレクトリにコピー。

$ cd make_thumb_sample/
$ cp /usr/local/bin/cyg*.dll ../ffmpeg
$ cp ../ffmpeg/*/*.a ./

するとmakeは通った。

  • しかし, 実行すると, エラー?が出現。

sample.jpegは生成されるが, フレームの内容を反映していない。

$ ./make_thumb sample.mov sample.jpeg
Compiler did not align stack variables. Libavcodec has been miscompiled
and may be very slow or crash. This is not a bug in libavcodec,
but in the compiler. You may try recompiling using gcc >= 4.2.
Do not report crashes to FFmpeg developers.

gcc4.3.2で・・
サンプルをmakeしたところ, 変更なし。
configureをして, makeでエラーが発生。