James Nguyen
James Nguyen

Reputation: 91

Using MediaCodec to compress video

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.

Upvotes: 0

Views: 880

Answers (1)

Ganesh
Ganesh

Reputation: 5980

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.

Upvotes: 1

Related Questions