-
Notifications
You must be signed in to change notification settings - Fork 196
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
视频添加图层 #6
Comments
您好,我想实现的效果是把本地的时候不播放的情况下给每一帧的画面上填写一些图片或者文字,看了您的两个项目,暂时想到的方法是遍历视频文件的每一帧调用OffScreenCanvas例子给这一帧加上文件或者图片,然后保存起来,最后遍历完后把得到的所有图片生成一个视频,感觉这种效果不太好,请问如果是您的话,您是会怎样去实现呢,麻烦指点一下,感谢 |
我好像要做的就是给ProduceTextureView设置一个视频让它播放,但是我这样设置好像没有效果
// System.out.println("onSurfaceTextureUpdated onSurfaceTextureUpdated"); |
可以参照这个项目的H264Encoder的用法。在它的OnDrawListener里就可以给视频每一帧绘制各种东西了。文字需要先转为Bitmap再绘制。 |
在ProduceTextureView中
} 我是这样给ProduceTextureView设置视频的,但是在 |
你的surface有使用吗?ProduceTextureView有使用canvas绘制吗?mediaPlayer应该可以的,不过如果可以的话,播放视频还是用MediaCodec解码吧 |
首先感谢您的耐心解答,谢谢 private class PlayerVideo extends Thread{
|
我有空再看看 |
好的,感谢 |
您好,我现在改用MediaCodec播放视频,会在decoder.configure(format, surface, null, 0);这一行报错 以下是我修改ProduceTextureView后的代码 public class ProduceTextureView extends GLSurfaceTextureProducerView {
} |
应该在这项目上补充这些操作,这样才是完整的链路。否则视频解码这块缺失了,直接从对流的操作开始阅读代码还是让人迷惑的(最好放一个解析本地视频资源,然后对视频每一帧进行操作的样例) |
MediaCodec解析视频后,output成h264文件时,testVideoEncoder.write();时出现android.media.MediaCodec$CodecException: Error 0xffffffde |
@xiaotian317 @nishibaiyang 所以你们暂时可以先参考例子A,把前后两步替换掉就可以了 |
已完成使用MediaPlayer版的播放了,也就是可以从中获取视频数据了。当然音频数据另说。 |
好的,感谢热心指导,谢谢 |
您好,请问可以在后台(不在界面显示)给本地视频的每一帧进行绘制吗?
The text was updated successfully, but these errors were encountered: