如何通过Alchemy gcc编译ffmpeg?

所以我创建了ffmpeg配置文件,使其成为纯C(独立于平台,但理论上只是)

所以我的配置很简单(0.6.1,0.6.3测试):

./configure --disable-doc --disable-ffplay --disable-ffprobe --disable-ffserver --disable-avdevice --disable-avfilter --disable-pthreads --disable-everything --enable-muxer=flv --enable-encoder=flv --enable-encoder=h263 --disable-mmx --disable-shared --prefix=bin/ --disable-protocols --disable-network --disable-optimizations --disable-debug --disable-asm --disable-stripping 

在Linux上进行编译将在4个库中解析,总大小为1 mb。

但我需要使用自定义编译器编译ffmpeg(开源gcc模拟称为Adobe Alchemy ,让我们将C / c ++编译到Flash中)

它在标准化过程中给出了几乎每个文件的错误:

 Array @ARGV missing the @ in argument 1 of shift() at /home/rupert/Downloads/alchemy-ubuntu-v0.5a/achacks/gcc line 218. cc1: error: unrecognized command line option "-Wtype-limits" cc1: error: unrecognized command line option "-fno-signed-zeros" 

那么我该怎么办 – 如何通过炼金术编译ffmpeg(至少最小部分)?

更新如果我们手动修复错误(在configure.mak中有2个,在alchemy gcc中有一个),我们会得到一个非常混乱和长输出,如:

 > $ make -w install make: Entering directory `/home/rupert/Downloads/ffmpeg-0.6.1' AR libavformat/libavformat.a llvm-ld: error opening 'avformat/libavformat.l.bc' for writing! llvm-ranlib: Archive file does not exist INSTALL libavformat/libavformat.a install: cannot stat `libavformat/libavformat.a': No such file or directory llvm-ranlib: Archive file does not exist AR libavcodec/libavcodec.a llvm-ld: error opening 'avcodec/libavcodec.l.bc' for writing! llvm-ranlib: Archive file does not exist INSTALL libavcodec/libavcodec.a install: cannot stat `libavcodec/libavcodec.a': No such file or directory llvm-ranlib: Archive file does not exist AR libswscale/libswscale.a llvm-ld: error opening 'swscale/libswscale.l.bc' for writing! llvm-ranlib: Archive file does not exist INSTALL libswscale/libswscale.a install: cannot stat `libswscale/libswscale.a': No such file or directory llvm-ranlib: Archive file does not exist AR libavutil/libavutil.a llvm-ld: error opening 'avutil/libavutil.l.bc' for writing! llvm-ranlib: Archive file does not exist INSTALL libavutil/libavutil.a install: cannot stat `libavutil/libavutil.a': No such file or directory llvm-ranlib: Archive file does not exist INSTALL libavformat/avformat.h INSTALL libavformat/avio.h INSTALL libavformat/libavformat.pc INSTALL libavcodec/avcodec.h INSTALL libavcodec/avfft.h INSTALL libavcodec/dxva2.h INSTALL libavcodec/opt.h INSTALL libavcodec/vaapi.h INSTALL libavcodec/vdpau.h INSTALL libavcodec/xvmc.h INSTALL libavcodec/libavcodec.pc INSTALL libswscale/swscale.h INSTALL libswscale/libswscale.pc INSTALL libavutil/adler32.h INSTALL libavutil/attributes.h INSTALL libavutil/avstring.h INSTALL libavutil/avutil.h INSTALL libavutil/base64.h INSTALL libavutil/common.h INSTALL libavutil/crc.h INSTALL libavutil/error.h INSTALL libavutil/fifo.h INSTALL libavutil/intfloat_readwrite.h INSTALL libavutil/log.h INSTALL libavutil/lzo.h INSTALL libavutil/mathematics.h INSTALL libavutil/md5.h INSTALL libavutil/mem.h INSTALL libavutil/pixdesc.h INSTALL libavutil/pixfmt.h INSTALL libavutil/rational.h INSTALL libavutil/sha1.h INSTALL libavutil/avconfig.h INSTALL libavutil/libavutil.pc LD ffmpeg_g WARNING: While resolving call to function 'main' arguments were dropped! Cannot yet select: 0x8e707e8: i32 = ConstantPool  0 llc[0x86c7dec] make: *** [ffmpeg_g] Error 6 make: Leaving directory `/home/rupert/Downloads/ffmpeg-0.6.1' 

FlasCC(Alchemy 2)确实编译了ffmpeg – 对于任何正在尝试的人来说,基本上你需要下载ffmpeg源码。 转到ffmpeg目录,执行

 PATH=/cygdrive/c/PATH_TO_FLASCC/sdk/usr/bin:$PATH ./configure --prefix=/cygdrive/c/PATH_TO_FLASCC/sdk/usr 

现在,如果你运行configure有一些限制,这是好的,所以它不包括每个编解码器或filter(需要很长时间)。 我的用例中的其他配置参数:

 --disable-ffserver --disable-everything --enable-filter=scale --enable-demuxer=flv --enable-muxer=ogg --enable-protocol=file --disable-network --disable-debug --disable-yasm --disable-asm --disable-stripping --enable-memalign-hack --disable-shared --enable-decoder=flashsv --enable-encoder=mpeg1video --enable-encoder=libtheora --enable-encoder=libvorbis --enable-libtheora --enable-libvorbis 

重要的是 – --disable-everything ,然后只启用您需要的内容。

然后运行./make./make install(在这些命令前面有PATH),它应该生成并安装ffmpeg libs。

当我构建一个测试swf时,一切似乎都有效。 我已经使用了他们(修改过的)样本,他们编码了25个虚拟mpeg帧。 我至少跟踪编码进度并看到正在编码的帧。

但是,SWC是一个问题,如果您想要使用它。 我得到奇怪的错误 – 首先它找不到编解码器(使用find codec函数时得到NULL),当我按名称指定它时,它不能分配编解码器上下文(也得到NULL)。 然后我用纯Flex编译它,它克服了这个,但无法打开编解码器(基本上所有这些都是av_某些库函数)。 我真的不明白为什么SWC不能使用这些,因为使用emit-swf一切都很好。

也许有人可以启发SWC / SWF的差异。

这里有关于Adobe Forums的一些讨论。 虽然有些人似乎取得了一些进展,但它似乎相当复杂。

尝试使用新的flash c编译器Adobe Flash cc 。 我希望它可以帮助你在flash中编译ffmpeg。