ChinaFFmpeg

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 9099|回复: 1

[Android] android 编译ffmpeg+x264出现找不到libx264文件

[复制链接]
发表于 2013-11-27 14:08:57 | 显示全部楼层 |阅读模式
1.在ubuntu下进行的编译
2.使用的是ndk-r6版本
3.首先用ndk编译生成了libx264.a静态库
4.编译ffmpeg
shell如下:
#!/bin/bash
PKG_CONFIG_PATH="/home/sfj/ffmpeg-x264/ffmpeg-0.8.1/jni/lib/pkgconfig"  
exportPKG_CONFIG_PATH
PREBUILT=/home/sfj/ndk6/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86
PLATFORM=/home/sfj/ndk6/android-ndk-r6/platforms/android-9/arch-arm
./configure  \
--cc=$PREBUILT/bin/arm-linux-androideabi-gcc\
--cross-prefix=$PREBUILT/bin/arm-linux-androideabi-\
--extra-cflags="-I/home/sfj/ffmpeg-x264/ffmpeg-0.8.1/jni/include  -fPIC -DANDROID" \
--extra-ldflags="-L/home/sfj/ffmpeg-x264/ffmpeg-0.8.1/jni/lib -Wl,-T,$PREBUILT/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.x-Wl,-rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib -nostdlib$PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/crtbegin.o$PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/crtend.o -lc -lm -ldl" \
--bindir="/home/sfj/ffmpeg-x264/ffmpeg-0.8.1/jni/bin"\
--extra-libs="-ldl"\
--target-os=linux\
--arch=arm \
--enable-version3\
--enable-gpl \
--enable-nonfree\
--disable-stripping\
--disable-ffmpeg\
--disable-ffplay\
--disable-ffserver\
--disable-ffprobe\
--enable-muxers\
--disable-devices\
--disable-protocols\
--enable-protocol=file\
--enable-libx264\
--enable-encoder=libx264\
--enable-decoder=h264\
--enable-avfilter\
--enable-network\
--enable-avdevice\
--disable-asm \
--enable-cross-compile\
--strip=$PREBUILT/bin/arm-linux-androideabi-strip\


shell结束
5.运行config.sh的时候,log如下:
BEGIN/tmp/ffconf.ipMEIwvE.c    1    #include<x264.h>    2    intx;END/tmp/ffconf.ipMEIwvE.c/home/sfj/ndk6/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600-I/home/sfj/ffmpeg-x264/ffmpeg-0.8.1/jni/include -fPIC -DANDROID -std=c99-fomit-frame-pointer -marm -E -o /tmp/ffconf.fvEcZ5qx.o /tmp/ffconf.ipMEIwvE.cIn file includedfrom /tmp/ffconf.ipMEIwvE.c:1:/home/sfj/ffmpeg-x264/ffmpeg-0.8.1/jni/include/x264.h:36:4:warning: #warning You must include stdint.h or inttypes.h before x264.hcheck_funcx264_encoder_encode_open -lx264check_ld -lx264check_ccBEGIN/tmp/ffconf.ipMEIwvE.c    1    externint x264_encoder_encode_open();    2    intmain(void){ x264_encoder_encode_open(); }END/tmp/ffconf.ipMEIwvE.c/home/sfj/ndk6/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc-D_ISOC99_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -I/home/sfj/ffmpeg-x264/ffmpeg-0.8.1/jni/include-fPIC -DANDROID -std=c99 -fomit-frame-pointer -marm -c -o/tmp/ffconf.fvEcZ5qx.o /tmp/ffconf.ipMEIwvE.c/home/sfj/ndk6/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc-L/home/sfj/ffmpeg-x264/ffmpeg-0.8.1/jni/lib-Wl,-T,/home/sfj/ndk6/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/arm-linux-androideabi/lib/ldscripts/armelf_linux_eabi.x-Wl,-rpath-link=/home/sfj/ndk6/android-ndk-r6/platforms/android-9/arch-arm/usr/lib-L/home/sfj/ndk6/android-ndk-r6/platforms/android-9/arch-arm/usr/lib -nostdlib/home/sfj/ndk6/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3/crtbegin.o/home/sfj/ndk6/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/lib/gcc/arm-linux-androideabi/4.4.3/crtend.o-lc -lm -ldl -Wl,--as-needed -o /tmp/ffconf.OaCCfh2T /tmp/ffconf.fvEcZ5qx.o-lx264 -ldl/home/sfj/ndk6/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.4.3/../../../../arm-linux-androideabi/bin/ld:warning: cannot find entry symbol _start; defaulting to 00008384/tmp/ffconf.fvEcZ5qx.o:In function `main':ffconf.ipMEIwvE.c.text+0x4):undefined reference to `x264_encoder_encode_open'collect2: ldreturned 1 exit statusERROR: libx264not found
希望大牛给指点一下

回复

使用道具 举报

发表于 2013-12-11 10:06:46 | 显示全部楼层
链接找不到libx264.a或者libx264.so,请确认你的指定目录下有着个库:
/home/sfj/ffmpeg-x264/ffmpeg-0.8.1/jni/lib
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|Archiver|ChinaFFmpeg

GMT+8, 2024-12-27 13:56 , Processed in 0.046106 second(s), 14 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表