Search code examples
androidandroid-mediacodecmediamuxer

Android Mediamuxer moov atom


I am recording device screen using Mediacodec and Mediamuxer api everything is fine.

Now I want to stream this file while recording, but cant until muxer is stopped and moov atom is written at the end of file.

So my question is it even possible using Mediamuxer for the purpose? If not what are the alternatives?

This is what I want to do, if not possible how cyanogen is doing?


Solution

  • No, it's not possible.

    In order to send an MP4 file while it is being written, you need to write fragmented MP4, and MediaMuxer only writes non-fragmented MP4.