MediaCodec storeMetaDataInBuffers应用自己分配buffer设给编码器


https://stackoverflow.com/questions/31899396/mediacodec-is-giving-a-storemetadatainbuffers-trace-error



I'm getting on the logcat the next error while encoding via the MediaCodec in Android.

The actual encoding works fine and the output is produced correctly, so I can't really understand why I get this trace. Is it a harmless error trace, or is there something I'm missing?

E/ACodec(6438): [OMX.qcom.video.encoder.h263] storeMetaDataInBuffers (output) failed w/ err -1010

Next is the code where I get the trace

final int BIT_RATE          = 4000000;
final int FRAME_RATE        = 30;
final int IFRAME_INTERVAL   = 5;
final String MIME_TYPE      = "video/avc";

final MediaFormat format = MediaFormat.createVideoFormat(MIME_TYPE, width, height);
format.setInteger(MediaFormat.KEY_COLOR_FORMAT, MediaCodecInfo.CodecCapabilities.COLOR_FormatSurface);
format.setInteger(MediaFormat.KEY_BIT_RATE, BIT_RATE);
format.setInteger(MediaFormat.KEY_FRAME_RATE, FRAME_RATE);
format.setInteger(MediaFormat.KEY_I_FRAME_INTERVAL, IFRAME_INTERVAL);

MediaCodec encoder = MediaCodec.createEncoderByType(MIME_TYPE);

//---------------------------------
// NEXT LINE PRODUCES THE TRACE
encoder.configure(format, null, null, MediaCodec.CONFIGURE_FLAG_ENCODE);
//---------------------------------
share improve this question
 

2 Answers

up vote 2 down vote accepted

It's harmless, most devices show this. See Q12 at http://bigflake.com/mediacodec/.

This only tells that the first way of signaling surface encoding wasn't supported by the encoder, so it used some other ways of setting it up. (There are multiple ways for the MediaCodec/ACodec layer to tell the individual encoder about it.)

share improve this answer
 

The previous answer has indicated that the warning is quite harmless. Some additional information on the log and reasons behind the same

This trace in the log is indicating that the encoder is not supporting storeMetadataInBuffers on the output port. For an encoder, this mode could be supported on both input and output ports.

This mode is employed for input port to pass raw image data in metadata format i.e. pass only a reference to the gralloc handle which can employed by the encoder to access the data. This is employed by the camera and/or other screen recording applications to pass a reference to YUVdata to the encoder.

The metadata mode was supported for output port also for potential encapsulation of output bitstream data. For example, when a Miracast or WiFi-Display session is active and the data being encoded is secure like a premium content, it becomes necessary to protect data between the encoder and HDCP encryption module, during which metadata format becomes handy. Not many encoders support this mode and hence, you observe this warning.

share improve this answer
 
 
Then is there any configuration flag that can be set to avoid this trace, or is the trace just informative? –  PerracoLabs  Aug 9 '15 at 12:16
1  
@PerracoLabs.. It's just informative as it's part of the Stagefright framework. I think it can easily be ignored. Please note that the same print works for both input and output ports. Encoders should support this mode on input port for optimal usage. –  Ganesh  Aug 9 '15 at 12:22

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值