androidinstagramwhatsappandroid-mediacodecmp4parser

In order to make an MP4 in Instagram and Whatsapp previewable, should I move the MOOV box to the front of the file?


At the moment I've successfully generated MP4 files via MediaCodec, but I can't play them back in Instagram or Whatsapp after uploading them. Right now I assume that the problem lies with the MP4 files being not streamable as the MPEG4Writer says, and that in order to make them streamable, I have to move the MooV atom to the beginning of the MP4 file.

I know of the qt-faststart option in libav/ffmpeg, but I'm ruling that out because ffmpeg will bloat my APK size. I heard it's possible to do this using MP4Parser, though.

My questions:

  1. Is there any other alternative when it comes to moving the MooV atom to the beginning of the MP4 file?
  2. Does Instagram and Whatsapp require the MP4 file to be streamable like this?

Solution

  • Actually, you don't need all of libav/ffmpeg to use qt-faststart, it's a self-contained small application - you only need the single C file that it is contained in, so it's in practice a very small tool.

    I don't know if this is the reason why Instagram and Whatsapp can't work with your video, though, or if it is due to some other issue.