hackerdude/ffmpeg-ruby

Need help installing ffmpeg gem on Snow Leopard

Closed this issue · 2 comments

When I try installing the gem I get:

$ sudo gem install ffmpeg-ruby

Building native extensions. This could take a while...
ERROR: Error installing ffmpeg-ruby:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for libavformat/avformat.h... no
checking for libavformat/avformat.h in /opt/local/include,/usr/local/include,/usr/include... yes
checking for av_register_all() in -lavformat... no
checking for av_register_all() in -lavformat... no
You need to install or tell me where to find ffmpeg. Check the mkmf.log file to see what erred out.

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/ffmpeg-ruby-0.1.3 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/ffmpeg-ruby-0.1.3/ext/ffmpeg_ruby/gem_make.out

$ which ffmpeg
/opt/local/bin/ffmpeg

When I check my path
$ echo $PATH
/opt/local/bin:/opt/local/sbin::/usr/local/mysql/bin:/opt/subversion/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin::/opt/local/bin

So what am I missing?

Thx!

Hi,

Did you see the Mac notes on the README? Basically it boils down to:

  1. Make sure you have installed the ffmpeg from macports
  2. Figure out if your Mac is capable of 64-bit, and whether your ruby is 64 or 32 bit, and set the ARCHFLAGS to match your architecture.

If you still can't do it after following the directions in the readme, please submit the contents of the /Library/Ruby/Gems/1.8/gems/ffmpeg-ruby-0.1.3/ext/ffmpeg_ruby/mkmf.log which will have the flags and command lines that were attempted in order to find the libraries.

You may also want to check drbrain's ffmpeg-rb, which is further along than this library (unless of course you are feeling like helping out) - his can already do a transcode.

Thanks!

Yes, I read through the README and have installed ffmpeg through macport:

$ ffmpeg
FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/opt/local --disable-vhook --enable-gpl --enable-postproc --enable-avfilter --enable-avfilter-lavf --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libdirac --enable-libschroedinger --enable-libfaac --enable-libfaad --enable-libxvid --enable-libx264 --mandir=/opt/local/share/man --enable-shared --enable-pthreads --cc=/usr/bin/gcc-4.2 --arch=x86_64 --disable-mmx --disable-mmx2 --disable-sse --disable-ssse3 --disable-amd3dnow --disable-amd3dnowext
libavutil 49.15. 0 / 49.15. 0
libavcodec 52.20. 0 / 52.20. 0
libavformat 52.31. 0 / 52.31. 0
libavdevice 52. 1. 0 / 52. 1. 0
libavfilter 1. 4. 0 / 1. 4. 0
libpostproc 51. 2. 0 / 51. 2. 0
built on Sep 9 2009 22:25:39, gcc: 4.2.1 (Apple Inc. build 5646)
At least one output file must be specified

I am not familiar with ARCHFLAGS and extconf.rb so was hoping to get a little help in that direction. Here is my mkmf.log

have_header: checking for libavformat/avformat.h... -------------------- no

"gcc -E -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -o conftest.i"
conftest.c:1:34: error: libavformat/avformat.h: No such file or directory
checked program was:
/* begin /
1: #include <libavformat/avformat.h>
/
end */


find_header: checking for libavformat/avformat.h in /opt/local/include,/usr/local/include,/usr/include... -------------------- yes

"gcc -E -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -o conftest.i"
conftest.c:1:34: error: libavformat/avformat.h: No such file or directory
checked program was:
/* begin /
1: #include <libavformat/avformat.h>
/
end */

"gcc -E -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -I/opt/local/include conftest.c -o conftest.i"
checked program was:
/* begin /
1: #include <libavformat/avformat.h>
/
end */


have_library: checking for av_register_all() in -lavformat... -------------------- no

"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -lruby -lavformat -lpthread -ldl "
conftest.c: In function ‘t’:
conftest.c:3: error: ‘av_register_all’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
conftest.c: In function ‘t’:
conftest.c:3: error: ‘av_register_all’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
lipo: can't figure out the architecture type of: /var/tmp//ccJ3rPj1.out
checked program was:
/* begin /
1: /top/
2: int main() { return 0; }
3: int t() { void ((volatile p)()); p = (void (()()))av_register_all; return 0; }
/
end */

"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -lruby -lavformat -lpthread -ldl "
ld: library not found for -lavformat
collect2: ld returned 1 exit status
ld: library not found for -lavformat
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccNdYPEs.out (No such file or directory)
checked program was:
/* begin /
1: /top/
2: int main() { return 0; }
3: int t() { av_register_all(); return 0; }
/
end */


find_library: checking for av_register_all() in -lavformat... -------------------- no

"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -lruby -lavformat -lpthread -ldl "
conftest.c: In function ‘t’:
conftest.c:3: error: ‘av_register_all’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
conftest.c: In function ‘t’:
conftest.c:3: error: ‘av_register_all’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
lipo: can't figure out the architecture type of: /var/tmp//ccUr9OgL.out
checked program was:
/* begin /
1: /top/
2: int main() { return 0; }
3: int t() { void ((volatile p)()); p = (void (()()))av_register_all; return 0; }
/
end */

"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L. -arch i386 -arch x86_64 -lruby -lavformat -lpthread -ldl "
ld: library not found for -lavformat
collect2: ld returned 1 exit status
ld: library not found for -lavformat
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccSZRGr4.out (No such file or directory)
checked program was:
/* begin /
1: /top/
2: int main() { return 0; }
3: int t() { av_register_all(); return 0; }
/
end */

"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/opt/local/lib -L. -arch i386 -arch x86_64 -lruby -lavformat -lpthread -ldl "
conftest.c: In function ‘t’:
conftest.c:3: error: ‘av_register_all’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
conftest.c: In function ‘t’:
conftest.c:3: error: ‘av_register_all’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
lipo: can't figure out the architecture type of: /var/tmp//ccuFTRVs.out
checked program was:
/* begin /
1: /top/
2: int main() { return 0; }
3: int t() { void ((volatile p)()); p = (void (()()))av_register_all; return 0; }
/
end */

"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/opt/local/lib -L. -arch i386 -arch x86_64 -lruby -lavformat -lpthread -ldl "
ld: warning: in /opt/local/lib/libavformat.dylib, file is not of required architecture
Undefined symbols for architecture i386:
"_av_register_all", referenced from:
_t in cctWRIzX.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//cc0Ejw1k.out (No such file or directory)
checked program was:
/* begin /
1: /top/
2: int main() { return 0; }
3: int t() { av_register_all(); return 0; }
/
end */

"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/usr/local/lib -L. -arch i386 -arch x86_64 -lruby -lavformat -lpthread -ldl "
conftest.c: In function ‘t’:
conftest.c:3: error: ‘av_register_all’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
conftest.c: In function ‘t’:
conftest.c:3: error: ‘av_register_all’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
lipo: can't figure out the architecture type of: /var/tmp//ccfCNK5d.out
checked program was:
/* begin /
1: /top/
2: int main() { return 0; }
3: int t() { void ((volatile p)()); p = (void (()()))av_register_all; return 0; }
/
end */

"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/usr/local/lib -L. -arch i386 -arch x86_64 -lruby -lavformat -lpthread -ldl "
ld: library not found for -lavformat
collect2: ld returned 1 exit status
ld: library not found for -lavformat
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccwwKxGU.out (No such file or directory)
checked program was:
/* begin /
1: /top/
2: int main() { return 0; }
3: int t() { av_register_all(); return 0; }
/
end */

"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/usr/lib -L. -arch i386 -arch x86_64 -lruby -lavformat -lpthread -ldl "
conftest.c: In function ‘t’:
conftest.c:3: error: ‘av_register_all’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
conftest.c: In function ‘t’:
conftest.c:3: error: ‘av_register_all’ undeclared (first use in this function)
conftest.c:3: error: (Each undeclared identifier is reported only once
conftest.c:3: error: for each function it appears in.)
lipo: can't figure out the architecture type of: /var/tmp//ccBIC99z.out
checked program was:
/* begin /
1: /top/
2: int main() { return 0; }
3: int t() { void ((volatile p)()); p = (void (()()))av_register_all; return 0; }
/
end */

"gcc -o conftest -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin10.0 -I. -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -arch i386 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common conftest.c -L. -L/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib -L/usr/lib -L. -arch i386 -arch x86_64 -lruby -lavformat -lpthread -ldl "
ld: library not found for -lavformat
collect2: ld returned 1 exit status
ld: library not found for -lavformat
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccTc3JEd.out (No such file or directory)
checked program was:
/* begin /
1: /top/
2: int main() { return 0; }
3: int t() { av_register_all(); return 0; }
/
end */


Thx!