MasayukiSuda / Mp4Composer-android

This library generate an Mp4 movie using Android MediaCodec API and apply filter, scale, trim, transcode, crop, timeScale, mute and rotate Mp4.
MIT License
956 stars 219 forks source link

generated video is not playable on browsers #90

Open maxsap opened 3 years ago

maxsap commented 3 years ago

Hello, I am trying to generate a video in mp4 encoding that is working on web browsers on web browsers but it seems that the generated video is not compatible. I have tried specifying the mime type but that did not really help

maxsap commented 3 years ago

I did a little bit of debugging and saw that the method "createVideoOutputFormatWithAvailableEncoders" is having a hierarchy of codecs that it chooses from. In my case it used HVEC for whatever reason even though I have enabled composer .videoFormatMimeType(VideoFormatMimeType.MPEG4)

vaibhavpandeyvpz commented 3 years ago

I set it to AVC and it now plays and encodes fine on most devices. The default HEVC selection even failed to encode on 50% of the devices.

maxsap commented 3 years ago

That indeed solved the issue, maybe this was a debugger issue but it seemed that this flag just worked as the "auto" mode