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

求添加文本到视频 #2

Closed
xulingchung2016 opened this issue Jun 13, 2017 · 7 comments
Closed

求添加文本到视频 #2

xulingchung2016 opened this issue Jun 13, 2017 · 7 comments

Comments

@xulingchung2016
Copy link

大神,能写个添加文本到视频里的效果吗?感激不敬

@ChillingVan
Copy link
Owner

要添加文本的话,只能先用普通的Canvas把文本写到一个bitmap里面,再用canvas.drawBitmap。在
https://github.com/ChillingVan/android-openGL-canvas、
这里的 CompareCanvas 里有画文字的例子。
如果你的添加文字的数量不用很多的话,没有性能影响,可以用这种方法,否则会影响性能。

另外如果你是追求弹幕那种效果的话,建议你用一个普通的View覆盖到TextureView上,你可以参考一下
DanmakuView
https://github.com/Bilibili/DanmakuFlameMaster

@xulingchung2016
Copy link
Author

我是想添加个时间信息,每隔一秒更新一下。还有问一下,把录制视频保存到本地.mp4的话在哪里处理。你现在保存的是.flv格式。

@ChillingVan
Copy link
Owner

哦哦,那你可以先把每个数字变成bitmap,一个9个,所以还好不会耗性能。
MP4我没做啊...你可以自己做,用Android自己的MediaMuxer就可以了。

@xulingchung2016
Copy link
Author

大神,问一下,GLsurfaceView 支持添加图片之类的吗?我看你用的是TexttureView

@ChillingVan
Copy link
Owner

@xulingchung2016 GLSurfaceView 作为 View 的话有类似 GLTextureView 的功能。不过在视频这一块,因为要共享SurfaceTexture给Camera,所以只能支持TextureView,不支持GLSurfaceView。

@baiyangyan
Copy link

大神,问下 我继承了IMuxer 把 video 和 audio 单独保存 用potplayer 播放 H264 能播放 , acc 不能 播放 , 请问下什么原因 ,而且 点击停止 报错了 ![default](https://user-images.githubusercontent.com/32259392/30798479-6c3fd438-a20c-11e7-9440-fd2356e14f75.png) 我刚接触这一块,请大神帮忙指点一二

@ChillingVan
Copy link
Owner

@baiyangyan 能另外开个issue吗?另外我的例子能跑通吗?

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