Wednesday, December 5, 2012

[android-developers] Media Codec API problem - is it by design?

Dear all,

we finally have a working app decoding H264 video from a live source using the new MediaCodec API. If we do not pass any surface object in the Configure method of the MediaCodec, we can read the decoded buffers in YUV format after each call to DequeueOutputBuffer. Now, when we pass a surface object in Configure, the video is being rendered fine, but DequeueOutputBuffer does not give us the access to the decoded data any more. The returned BufferInfo object has a size of zero and MediaCodec.OutputFormat shows correct video dimensions but an (undocumented) color format value of 256.

Is this behavior by design, ie. do we have to choose between rendering the decoded data or accessing the data? How can we access the decoded data when configuring the MediaCodec to render the output as well?

Thanks for any suggestions.

Alex

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

1 comment:

  1. The reason may be that you provide a surface to render. If the decoder has a surface, it will report 0 size. If you remove the surface from configure() maybe you will get the correct size for outputbuffers?

    ReplyDelete