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

由于看不到ndk的源码, 所以有个问题请教 #5

Closed
alexliyu7352 opened this issue Dec 16, 2018 · 7 comments
Closed

由于看不到ndk的源码, 所以有个问题请教 #5

alexliyu7352 opened this issue Dec 16, 2018 · 7 comments

Comments

@alexliyu7352
Copy link

你这里的应该也是修改了ffmpeg.c实现的cmd命令功能吧?
我想请教下, 如果多个线程执行. 怎么保证线程安全呢?
因为我看ffmpeg.c这个文件里面的main实际上并不是线程安全的,
也就是在java层只能阻塞调用或者队列调用命令.
没办法一次执行多个命令.是么?

@microshow
Copy link
Owner

如果要一次执行多条命令,可以开多个进程去实现的

@alexliyu7352
Copy link
Author

java层多个进程, 还是直接在native层 fork出来

@microshow
Copy link
Owner

ndk层开启多进程可能在各个系统版本有些限制,为了保险起见建议可以用java层多进程,后续我会考虑在ndk层去实现支持多进程运行ffmpeg……

@alexliyu7352
Copy link
Author

其实还是最好多线程实现, 因为多进程太重了, 况且android就算java层也有限制.
但是不知道如何多线程实现, 看来不能直接使用ffmpeg.c, 必须要自己重新封装transcode的代码.
也只有这个办法是么?

@microshow
Copy link
Owner

其实有试过在ndk层多线程去实现,但中断当前命令不太好优雅的中断,而且会引发比较多的问题

@microshow
Copy link
Owner

V1.2.0版本特性:提升转码效率,重新编译ffmpeg,修复拼接视频出错的bug,支持更多格式,包括支持mp3,aac,wav等格式的音频导出,丰富了更多功能,欢迎更新!

@microshow
Copy link
Owner

可以更新V2.0.0版本,速度嗖嗖的

@mrqinshou mrqinshou mentioned this issue Jul 4, 2022
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

2 participants