Sulaiman Khan
Sulaiman Khan

Reputation: 908

Android app crash while converting with media codec with MP4 formatting?

I have an app which get data as byte from onPreviewFrame and pass to my encoder which is another class implement media codec api of android get data and make a video file. It works file with format "video/avc" but crash fro "mpeg4" with showing a thread error. What could be the reason?

Upvotes: 1

Views: 779

Answers (1)

Alex Cohn
Alex Cohn

Reputation: 57163

Please study the excellent explanation at http://bigflake.com/mediacodec/. Specifically, MediaCodec.createEncoderByType(MIME_TYPE) may throw exception. Maybe your device expects "video/mp4v-es" for MPEG4 video.

If possible, it is preferred to use MediaCodec.findEncoderForFormat(MediaFormat).

Upvotes: 1

Related Questions