0

I'm trying to use MediaCodec in Android to compress videos.

It looks like MediaCodec will give you back the raw stream. Is there a way to go from A->B (compress video with an output file at the end)?

Thanks.

Ganesh
  • 5,880
  • 2
  • 36
  • 54
James Nguyen
  • 91
  • 1
  • 3
  • 12

1 Answers1

1

You can employ the MediaMuxer class to store the elementary streams into a file format like MP4. Please refer to this cts example for a good illustration of transcode + muxing where the encoded data is written into a file through the MediaMuxer.

Ganesh
  • 5,880
  • 2
  • 36
  • 54
  • Sir, Can you please take a look at this thread? http://stackoverflow.com/questions/32723393/video-rendering-is-broken-mediacodec-h-264-stream – Kaidul Sep 22 '15 at 17:42