简体   繁体   English

如何在MediaCodec Android中实现跳帧

[英]How to implement frame skipping in MediaCodec android

I'm making an app which is using MediaCodec APIs. 我正在制作一个使用MediaCodec API的应用程序。 The app runs on two phones. 该应用程序可在两部手机上运行。 The first phone reads the video from the sdcard and then uses the MediaCodec encoder to encode the frames in avc format and then streams the frames to another device. 第一个电话从sdcard读取视频,然后使用MediaCodec编码器以avc格式编码帧,然后将帧流式传输到另一个设备。 The second device has a MediaCodec decoder running. 第二个设备正在运行MediaCodec解码器。 The decoder decodes the frames and render them on a Surface. 解码器解码这些帧并将其渲染到Surface上。 The code is running fine but after sometime when the size of the frames gets more, the first device is sometime not able to stream the video and the encoder stops reporting the following log : 代码运行正常,但是在某些时候帧大小变大之后,第一个设备有时无法流传输视频,并且编码器停止报告以下日志:

E/OMX-VENC-720p(  212): Poll timedout, pipeline stalled due to client/firmware ETB: 496, EBD: 491, FTB: 492, FBD: 492

So I want to implement frame skipping on the encoder side. 所以我想在编码器端实现跳帧。 What's the best way to skip the frames and not stream them to the other device. 跳过帧而不将其流式传输到其他设备的最佳方法是什么。 ?

PS. PS。 On a separate note if anyone can suggest me of any other way of streaming a video to other device it'll be really nice. 另外,如果有人可以向我建议将视频流传输到其他设备的任何其他方式,那就太好了。

Please try Intel INDE Media Pack with tutorials on https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials . 请尝试使用https://software.intel.com/zh-cn/articles/intel-inde-media-pack-for-android-tutorials上的教程的Intel INDE Media Pack。 It has Camera, File and Game streaming components, which make streaming with help of Wowza and a set of samples demonstrating how to use it as a server and as a client 它具有“相机”,“文件”和“游戏”流媒体组件,这些组件在Wowza的帮助下进行流媒体播放,并提供了一组示例,演示了如何将其用作服务器和客户端

在此处输入图片说明

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM