android virtualdisplay_控制VirtualDisplay的帧速率

在Android应用中,创建了一个VirtualDisplay用于屏幕镜像,并将屏幕帧传递给MediaCodec。现希望限制编码视频的FPS,但不清楚如何操作。尝试通过丢弃编码帧来降低FPS,但会导致视频质量下降。尝试通过限制传入MediaCodec的FPS,但VirtualDisplay仅接收从MediaCodec创建的Surface。尝试从encoder-decoder-encoder路径并限制第二个encoder的帧率,但会增加额外计算。寻求成功限制VirtualDisplay帧率的方法。
摘要由CSDN通过智能技术生成

bd96500e110b49cbb3cd949968f18be7.png

I'm writing an Android application, and in it, I have a VirtualDisplay to mirror what is on the screen and I then send the frames from the screen to an instance of a MediaCodec. It works, but, I want to add a way of specifying the FPS of the encoded video, but I'm unsure how to do so.

From what I've read and experimented with, dropping encoded frames (based on the presentation times) doesn't work well as it ends up with blocky/artifact ridden video as opposed to a smooth video at a lower framerate. Other reading suggests that the only way to do what I want (limit the FPS) would be to limit the incoming FPS to the MediaCodec, but the VirtualDisplay just receives a Surface which is constructed from the MediaCodec as below

mSurface = .createInputSurface();

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值