然而,另一个的ffmpeg / libx264问题 [英] Yet another ffmpeg/libx264 issue

查看:2140
本文介绍了然而,另一个的ffmpeg / libx264问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前的情况是, FFMPEG和libx264已经被编译为Android,为共享,并分别静态库。因为我有libx264.a和我libffmpeg.so,只有剩下的事情就是将它们链接并获得的ffmpeg库,让我与我的应用程序进行。然而,一些问题仍然悬而未决。我的Windows 7,我用的X264的最后一个版本,ffmpeg的0.10.4版本NDK和7下使用Ubuntu与虚拟机

我曾尝试以包括libx264到ffmpeg的编译过程,以及调整标志(extracf和extrald),但​​我一直失败。下面你可以找到ffmpeg的和我的构建脚本我所遇到的错误。

  NDK =〜/ Android_NDK_r7b
平台= $ NDK /平台/ Android的-8 /弓臂/
preBUILT = $ NDK /工具链/ ARM-Linux的androideabi-4.4.3 / prebuilt / Linux的x86的
X264 =的/ usr /本地
#x264v2 =〜/ X264
功能build_one
{
的./configure --target-OS = Linux的\\
     - preFIX = $preFIX \\
    --enable-交叉编译\\
    --extra-库= - lgcc\\
    --arch =手臂\\
    --CC = $preBUILT /斌/ ARM-Linux的androideabi-GCC \\
    --cross- preFIX = $preBUILT /斌/ ARM-Linux的androideabi- \\
    --nm = $preBUILT /斌/ ARM-Linux的androideabi纳米\\
    --sysroot = $ PLATFORM \\
   #--extra-CFLAGS =-O3 -fpic -DANDROID -DHAVE_SYS_UIO_H = 1 -Dipv6mr_interface = ipv6mr_ifindex -fasm -Wno-psabi了-fno-short-枚举-fno严格走样-finline极限= $ 300 OPTIMIZE_CFLAGS\\
    --extra-CFLAGS = - I $ X264 /包括\\
    --enable-共享\\
    --enable-静\\
    # - 超LDFLAGS = - WL,-rpath链接= $平台/ usr / lib目录-L $平台/ usr / lib目录-nostdlib -lc -lm -ldl -llog\\
    --extra-LDFLAGS =L - $ X264 / lib目录\\
   --disable-一切\\
   #--enable-分路器= MOV \\
   #--enable-分路器= H264 \\
   #--disable-ffplay \\
    --enable-GPL \\
    --enable-libx264 \\
   #--enable-协议=文件\\
   #--enable-avformat \\
   #--enable-AV codeC \\
   #--enable-CN codeR = libx264 \\
   #--enable-DE codeR = rawvideo \\
   # - 让德codeR = MJPEG \\
   #--enable-DE codeR = H263 \\
   #--enable-DE codeR = MPEG4 \\
   #--enable-CN codeR = H264 \\
   #--disable网\\
    # - 启用 - zlib的\\
   #--disable-avfilter \\
    # - 禁用 - avdevice \\
    $ ADDITIONAL_CONFIGURE_FLAG使清洁
使-J4安装
$preBUILT /斌/ ARM-Linux的androideabi-ARðlibav codeC / libav codec.a inverse.o
$preBUILT /斌/ ARM-Linux的androideabi-LD -rpath链接= $平台/ usr / lib目录-L $平台/ usr / lib目录-soname libffmpeg.so -shared -nostdlib -z,noexecstack -Bsymbolic - -whole归档--no-未定义-o $preFIX / libffmpeg.so libav codeC / libav codec.a了libavformat / libavformat.a libavutil / libavutil.a libswscale / libswscale.a -lc -lm -lz -ldl -llog --warn一次--dynamic链接器= /系统/斌/连接器$preBUILT / lib中/ GCC / ARM-Linux的androideabi / 4.4.3 / libgcc.a中
}#arm v7vfpv3
CPU =的ARMv7-A
OPTIMIZE_CFLAGS = - mfloat-ABI = softfp -mfpu =的VFPv3-D16 -marm -march = $ CPU
preFIX = / androidIncludeTrialsNDK7 / $ CPU
ADDITIONAL_CONFIGURE_FLAG =
build_one

如果我基本上删除线extracf和extrald标志和使用其他的(评论出局),它工作正常,但没有发现错误libx264。否则,我得到以下误差修改。

  ./ buildnew.sh:第35行:--extra-CFLAGS = -I在/ usr /本地/包括:没有这样的文件或目录
./buildnew.sh:38行:--extra-LDFLAGS = -L在/ usr / local / lib目录:没有这样的文件或目录
./buildnew.sh:第40行:--disable-一切:命令未找到
./buildnew.sh:第44行:--enable-GPL:命令未找到

编译过程用下面的结束。

 使:*** [libavdevice / v4l.o]错误1
使:***等待未完成的工作....
/home/mehmet/Android_NDK_r7b/toolchains/arm-linux-androideabi-4.4.3/$p$pbuilt/linux-x86/bin/arm-linux-androideabi-ar:创建libav codeC / libav codec.a
/home/mehmet/Android_NDK_r7b/toolchains/arm-linux-androideabi-4.4.3/$p$pbuilt/linux-x86/bin/arm-linux-androideabi-ld:无法打开输出文件./androidIncludeTrialsNDK7/armv7-a/libffmpeg.so:没有这样的文件或目录

我已经安装在我的目录/ home /穆罕默德/ X264 X264,我也查whereis x264.a,它显示我作为在/ usr / local / lib目录。我试图改变路径$ X264指出家庭/穆罕默德/ X264文件夹,但我得到了同样的错误。

最后,如果我同时启用extracf和extrald标志(包括那些评论和使用的)。我得到上述同样的错误。我怕我在这里做一个简单的拼写错误,但不能老是看到它,它是推动我疯了。非常感谢你的帮助。

最佳。

修改

我删除了意见,现在得到如下。

  ./ buildnew.sh:4:./buildnew.sh:功能:未找到
错误:libx264未找到

上面的错误从终端,当我运行该脚本观察。它建高达一些点,并与下面的错误结束的过程。

  libav codeC / libav codec.a(libx264.o):在功能`X264_frame:
/home/mehmet/ffmpeg-0.10.4/libav$c$cc/libx264.c:159:未定义参考`x264_picture_init
/home/mehmet/ffmpeg-0.10.4/libav$c$cc/libx264.c:179:未定义的引用`x264_en coder_reconfig
/home/mehmet/ffmpeg-0.10.4/libav$c$cc/libx264.c:191:未定义的引用`x264_en coder_en code'
/home/mehmet/ffmpeg-0.10.4/libav$c$cc/libx264.c:197:未定义的引用`x264_en coder_delayed_frames
libav codeC / libav codec.a(libx264.o):在功能`恩code_nals:
/home/mehmet/ffmpeg-0.10.4/libav$c$cc/libx264.c:196:未定义参考`x264_bit_depth
libav codeC / libav codec.a(libx264.o):在功能`X264_close:
/home/mehmet/ffmpeg-0.10.4/libav$c$cc/libx264.c:231:未定义的引用`x264_en coder_close
libav codeC / libav codec.a(libx264.o):在功能`X264_init:
/home/mehmet/ffmpeg-0.10.4/libav$c$cc/libx264.c:284:未定义参考`x264_param_default
/home/mehmet/ffmpeg-0.10.4/libav$c$cc/libx264.c:292:未定义的引用`x264_param_default_ preSET
/home/mehmet/ffmpeg-0.10.4/libav$c$cc/libx264.c:305:未定义参考`x264_param_parse
/home/mehmet/ffmpeg-0.10.4/libav$c$cc/libx264.c:502:未定义参考`x264_param_apply_fastfirstpass
/home/mehmet/ffmpeg-0.10.4/libav$c$cc/libx264.c:505:未定义参考`x264_param_apply_profile
/home/mehmet/ffmpeg-0.10.4/libav$c$cc/libx264.c:544:未定义的引用`x264_en coder_open_125
/home/mehmet/ffmpeg-0.10.4/libav$c$cc/libx264.c:554:未定义的引用`x264_en coder_headers
./buildnew.sh:51:./buildnew.sh:build_one:未找到


解决方案

您的错误是没有关系的ffmpeg / libx264。你不能在中间的这些意见。再看误差

./ buildnew.sh:第35行:--extra-CFLAGS = -I在/ usr /本地/包括:没有这样的文件或目录

据认为--extra-CFLAGS是一个命令等了everyline是注释后的第一个。

您的命令应该是连续的,没有任何评论。在\\操作不从注释工作。

My current situation is; ffmpeg and libx264 has been compiled for Android, as shared and static libraries respectively. Since I have libx264.a and libffmpeg.so with me, only thing that remains is to link them and obtain a ffmpeg library that would allow me to proceed with my application. However, some questions remain unanswered. I am using Ubuntu with a virtual machine under Windows 7. I am using x264's last version, ffmpeg 0.10.4 release and NDK 7.

I have tried to adjust flags (extracf and extrald) in order to include libx264 to ffmpeg compilation process as well, however I keep failing. Below you may find my build script for ffmpeg and the errors I have encountered.

NDK=~/Android_NDK_r7b 
PLATFORM=$NDK/platforms/android-8/arch-arm/ 
PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86 
x264=/usr/local 
#x264v2=~/x264 
function build_one 
{ 
./configure --target-os=linux \ 
    --prefix=$PREFIX \ 
    --enable-cross-compile \ 
    --extra-libs="-lgcc" \ 
    --arch=arm \ 
    --cc=$PREBUILT/bin/arm-linux-androideabi-gcc \ 
    --cross-prefix=$PREBUILT/bin/arm-linux-androideabi- \ 
    --nm=$PREBUILT/bin/arm-linux-androideabi-nm \ 
    --sysroot=$PLATFORM \ 
   # --extra-cflags=" -O3 -fpic -DANDROID -DHAVE_SYS_UIO_H=1 -Dipv6mr_interface=ipv6mr_ifindex -fasm -Wno-psabi -fno-short-enums -fno-strict-aliasing -finline-limit=300 $OPTIMIZE_CFLAGS " \ 
    --extra-cflags="-I$x264/include" \ 
    --enable-shared \ 
    --enable-static \ 
    #--extra-ldflags="-Wl,-rpath-link=$PLATFORM/usr/lib  -L$PLATFORM/usr/lib -nostdlib -lc -lm -ldl -llog" \ 
    --extra-ldflags="-L$x264/lib" \ 
   --disable-everything \ 
   # --enable-demuxer=mov \ 
   # --enable-demuxer=h264 \ 
   # --disable-ffplay \ 
    --enable-gpl \ 
    --enable-libx264 \ 
   # --enable-protocol=file \ 
   # --enable-avformat \ 
   # --enable-avcodec \ 
   # --enable-encoder=libx264 \ 
   # --enable-decoder=rawvideo \ 
   #--enable-decoder=mjpeg \ 
   # --enable-decoder=h263 \ 
   # --enable-decoder=mpeg4 \ 
   # --enable-encoder=h264 \ 
   # --disable-network \ 
    #--enable-zlib \ 
   # --disable-avfilter \ 
    #--disable-avdevice \ 
    $ADDITIONAL_CONFIGURE_FLAG 

make clean 
make  -j4 install 
$PREBUILT/bin/arm-linux-androideabi-ar d libavcodec/libavcodec.a inverse.o 
$PREBUILT/bin/arm-linux-androideabi-ld -rpath-link=$PLATFORM/usr/lib -L$PLATFORM/usr/lib  -soname libffmpeg.so -shared -nostdlib  -z,noexecstack -Bsymbolic --whole-archive --no-undefined -o $PREFIX/libffmpeg.so libavcodec/libavcodec.a libavformat/libavformat.a libavutil/libavutil.a libswscale/libswscale.a -lc -lm -lz -ldl -llog  --warn-once  --dynamic-linker=/system/bin/linker $PREBUILT/lib/gcc/arm-linux-androideabi/4.4.3/libgcc.a 
} 

#arm v7vfpv3 
CPU=armv7-a 
OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=vfpv3-d16 -marm -march=$CPU " 
PREFIX=./androidIncludeTrialsNDK7/$CPU 
ADDITIONAL_CONFIGURE_FLAG= 
build_one 

If I basically delete the lines extracf and extrald flags and use other ones (commented outs), it works fine except libx264 not found error. Otherwise, I get the following erros.

./buildnew.sh: line 35: --extra-cflags=-I/usr/local/include: No such file or directory 
./buildnew.sh: line 38: --extra-ldflags=-L/usr/local/lib: No such file or directory 
./buildnew.sh: line 40: --disable-everything: command not found 
./buildnew.sh: line 44: --enable-gpl: command not found 

The compilation process ends with the following.

make: *** [libavdevice/v4l.o] Error 1 
make: *** Waiting for unfinished jobs.... 
/home/mehmet/Android_NDK_r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ar: creating libavcodec/libavcodec.a 
/home/mehmet/Android_NDK_r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ld: cannot open output file ./androidIncludeTrialsNDK7/armv7-a/libffmpeg.so: No such file or directory 

I have x264 installed in my directory /home/mehmet/x264 and I also check whereis x264.a, it shows me as /usr/local/lib. I have tried changing the path $x264 to point out to home/mehmet/x264 folder, but I get the same error.

Lastly, if I enable both extracf and extrald flags ( both commented ones and the used ones) . I get the same error mentioned above. I am afraid I am doing a simple typo here, but can`t see it and it is driving me crazy. Thanks a lot for your help.

Best.

EDIT

I have deleted the comments and now obtain the following.

./buildnew.sh: 4: ./buildnew.sh: function: not found
ERROR: libx264 not found

Above error is observed from the terminal when I run the script. It build upto some point and finishes the process with the following error.

libavcodec/libavcodec.a(libx264.o): In function `X264_frame':
/home/mehmet/ffmpeg-0.10.4/libavcodec/libx264.c:159: undefined reference to `x264_picture_init'
/home/mehmet/ffmpeg-0.10.4/libavcodec/libx264.c:179: undefined reference to `x264_encoder_reconfig'
/home/mehmet/ffmpeg-0.10.4/libavcodec/libx264.c:191: undefined reference to `x264_encoder_encode'
/home/mehmet/ffmpeg-0.10.4/libavcodec/libx264.c:197: undefined reference to `x264_encoder_delayed_frames'
libavcodec/libavcodec.a(libx264.o): In function `encode_nals':
/home/mehmet/ffmpeg-0.10.4/libavcodec/libx264.c:196: undefined reference to `x264_bit_depth'
libavcodec/libavcodec.a(libx264.o): In function `X264_close':
/home/mehmet/ffmpeg-0.10.4/libavcodec/libx264.c:231: undefined reference to `x264_encoder_close'
libavcodec/libavcodec.a(libx264.o): In function `X264_init':
/home/mehmet/ffmpeg-0.10.4/libavcodec/libx264.c:284: undefined reference to `x264_param_default'
/home/mehmet/ffmpeg-0.10.4/libavcodec/libx264.c:292: undefined reference to `x264_param_default_preset'
/home/mehmet/ffmpeg-0.10.4/libavcodec/libx264.c:305: undefined reference to `x264_param_parse'
/home/mehmet/ffmpeg-0.10.4/libavcodec/libx264.c:502: undefined reference to `x264_param_apply_fastfirstpass'
/home/mehmet/ffmpeg-0.10.4/libavcodec/libx264.c:505: undefined reference to `x264_param_apply_profile'
/home/mehmet/ffmpeg-0.10.4/libavcodec/libx264.c:544: undefined reference to `x264_encoder_open_125'
/home/mehmet/ffmpeg-0.10.4/libavcodec/libx264.c:554: undefined reference to `x264_encoder_headers'
./buildnew.sh: 51: ./buildnew.sh: build_one: not found

解决方案

Your errors are nothing to do with ffmpeg/libx264. You cannot have those comments in the middle. Look at the error

./buildnew.sh: line 35: --extra-cflags=-I/usr/local/include: No such file or directory

It thinks --extra-cflags is a command and so on for everyline that is the first one after the comment.

Your command should be continous and without any comments. The "\" operator does not work from comments.

这篇关于然而,另一个的ffmpeg / libx264问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆