Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

大师兄能把那编译ffmpeg的脚本提供一下吗 #93

Closed
bookzhan opened this issue Apr 12, 2017 · 42 comments
Closed

大师兄能把那编译ffmpeg的脚本提供一下吗 #93

bookzhan opened this issue Apr 12, 2017 · 42 comments

Comments

@bookzhan
Copy link

我用自己编译的ffmpeg库替换后,发现avcodec_encode_video2函数平均时间在40毫秒, 而用你的库时间在几毫秒, 其中也采用neno,但是效果不理想,不知道是哪儿出问题了. [email protected] 谢谢

@wysaid
Copy link
Owner

wysaid commented Apr 13, 2017

@yeoggc
Copy link

yeoggc commented Apr 13, 2017

wysaid/FFmpeg-Android上的FFmpeg不能正常编译,x264相关的checkout不下来,能看看什么原因吗?

@wysaid
Copy link
Owner

wysaid commented Apr 13, 2017

用这个吧: http://git.videolan.org/git/x264.git

@yeoggc
Copy link

yeoggc commented Apr 13, 2017

我用您给x264.git下载到FFmpeg-Android下,再运行FFmpeg-Android.sh,会报错 FFmpeg-Android/x264: No such file or directory

@wysaid
Copy link
Owner

wysaid commented Apr 13, 2017

脚本里面肯定有个下载 x264 的git链接, 你直接用上面的替换掉脚本里面的x264链接, 然后再运行呀

@yeoggc
Copy link

yeoggc commented Apr 13, 2017

我按照你说的重新试了下,遇到这情况:
make-standalone-toolchain.sh used to install a new toolchain into an existing
directory. This is not desirable, as it will not clean up any stale files. If
you wish to remove the install directory before creation, pass --force.
./FFmpeg-Android.sh: line 145: pushd: /Users/guanguocheng/Dev/DevProject/StudyProject2/new1/FFmpeg-Android/x264: No such file or directory
buiding x264 to /Users/guanguocheng/Dev/DevProject/StudyProject2/new1/FFmpeg-Android/build/x264/armv7
./FFmpeg-Android.sh: line 150: ./configure: No such file or directory
cp: config.*: No such file or directory

@yeoggc
Copy link

yeoggc commented Apr 13, 2017

我是用最新的NDK的,不知道有没影响?

@wysaid
Copy link
Owner

wysaid commented Apr 13, 2017

这……我也有点搞不清楚, 我用的时候没这问题, 直接搞定了

@yeoggc
Copy link

yeoggc commented Apr 13, 2017

我直接编译FFmpeg,不用x264,替换掉之前的ffmpeg,应该没问题的吧?

@wysaid
Copy link
Owner

wysaid commented Apr 13, 2017

不行的, 这样是没法录视频的

@yeoggc
Copy link

yeoggc commented Apr 13, 2017

这样啊,那您有没现成编译好的so库?直接发我?

@wysaid
Copy link
Owner

wysaid commented Apr 13, 2017

不是就在repo里面吗。。。

@yeoggc
Copy link

yeoggc commented Apr 13, 2017

我是个菜鸟,问下repo在哪里可以找到?

@wysaid
Copy link
Owner

wysaid commented Apr 13, 2017

被你替换掉的那个不就是吗

@yeoggc
Copy link

yeoggc commented Apr 13, 2017

替换掉的那个是不能执行ffmpeg命令,我想根据https://github.com/wysaid/FFmpeg-Android提供的重新编译一份可以执行ffmpeg命令的so库

@wysaid
Copy link
Owner

wysaid commented Apr 13, 2017

嗯, 了解了, 这个其实你可以网上找吧, 之后替换掉就行了

@yeoggc
Copy link

yeoggc commented Apr 13, 2017

我用最新版ffmpeg编译过并替换,发现您的ffmpeg库有的方法,最新版ffmpeg的没有,所以只能找ffmpeg对应的版本来编译了

@wysaid
Copy link
Owner

wysaid commented Apr 13, 2017

应该跟ffmpeg版本没关系, ffmpeg有很多模块, 可能你编译的版本少了某些必要的模块

@yeoggc
Copy link

yeoggc commented Apr 13, 2017

行我在仔细研究看,有不懂,只能在打扰你了

@wysaid
Copy link
Owner

wysaid commented Apr 13, 2017

嗯, 我倒是有个支持命令行的版本, 不过很多功能不支持, 只有简单的视频抽帧什么的,你先自己试试看吧

@yeoggc
Copy link

yeoggc commented Apr 14, 2017

我刚才试了下只编译ffmpeg无h264,替换后,测试了下是正常运行的

@wysaid
Copy link
Owner

wysaid commented Apr 14, 2017

666,
那你先试试看吧, 有问题了再说

@yeoggc
Copy link

yeoggc commented Apr 14, 2017

请问项目上so文件是用NDK哪个版本编译的?

@yeoggc
Copy link

yeoggc commented Apr 14, 2017

还有ffmpeg的版本是多少?

@bookzhan
Copy link
Author

这个脚本是不能直接运行的,是要修改的,我改了一下,亲测可用https://github.com/bookzhan/FFmpeg-Android-build.git

@wysaid
Copy link
Owner

wysaid commented Apr 14, 2017

厉害~
项目上的用的 ndk-r10e
但是我测试过最新的ndk-r13b也没问题

@bookzhan
Copy link
Author

bookzhan commented Apr 14, 2017

我把 把ffmpeg 切换成3.2.4 x264切换成最新的,亲测可用https://github.com/bookzhan/FFmpeg-Android-build.git 欢迎使用

@bookzhan
Copy link
Author

@wysaid 大神,你才是厉害,最近在学你的代码,打算逐步实现你的所写的功能,就算是学习了,还望多指教

@wysaid
Copy link
Owner

wysaid commented Apr 14, 2017

😋

@yeoggc
Copy link

yeoggc commented Apr 15, 2017

@bookzhan 问个小问题,armv7是不是就是armeabi-v7a??

@yeoggc
Copy link

yeoggc commented Apr 15, 2017

@bookzhan 您编译出来的ffmpeg包含h264的吗?

@yeoggc
Copy link

yeoggc commented Apr 15, 2017

@bookzhan 我用您编译的ffmpeg库替换项目中的,程序闪退并报以下异常java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "avcodec_alloc_frame" referenced by "libCGEExt.so"...。

@bookzhan
Copy link
Author

armv7是一个系列是向下兼容的,比如兼容v7a,v7r,v7m什么的,具体我也不太懂,你可以去查一下。库是包含h264的,现在库用的是FFmpeg3.2.4,而大师兄的项目采用的是2.1.2的FFmpeg所以api是不一样的,不过我也编译了一个2.1.2版本的,这个就需要你把仓库git下来,然后检出2.1.2的那个版本

@yeoggc
Copy link

yeoggc commented Apr 15, 2017

@bookzhan 我已经把你的仓库git下来了,我对git操作不太熟,具体怎么检出2.1.1版本,有点急,麻烦尽快回复谢谢了。

@bookzhan
Copy link
Author

@yeoggc git checkout 08214393daa0eeea5ca6d5aff1b149af48c8dd11 这个版本就是2.1.2的,build目录下就是已经编译好的,你从新运./FFmpeg-Android.sh所有的都就切换过来了

@yeoggc
Copy link

yeoggc commented Apr 16, 2017

@bookzhan 谢了,这个可以执行ffMpeg命令

@yeoggc
Copy link

yeoggc commented Apr 16, 2017

@bookzhan 我费了好大的精力就是用能执行ffmpeg命令so库想替换掉原来的,搞了几天都不行,郁闷中

@bookzhan
Copy link
Author

@yeoggc 能用就行,为了减少库的大小,库的功能还是限制了不少,你可以调整enable和disable来放开和关闭一些功能,如果有些FFmpeg命名不能执行的话,特别是有一个disable everthing

@yeoggc
Copy link

yeoggc commented Apr 16, 2017

@bookzhan 因为我实现视频录制功能,需要转格式,分段录制,音视频合并等,所以需要用到ffmpeg命令,您有啥好建议嘛

@bookzhan
Copy link
Author

@yeoggc 用ffmpeg命令不是好办法,你控制不了流程,建议用代码实现

@yeoggc
Copy link

yeoggc commented Apr 16, 2017

代码实现,你是说用C还是Java?

@bookzhan
Copy link
Author

c/c++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants