ypresto / android-transcoder

MP4 video transcode using Android MediaCodec API, pure Java (not LGPL nor patent issue!). Supports API >= 18.
Apache License 2.0
832 stars 238 forks source link

Non-baseline AVC video profile is not supported by Android OS (Android 9.0) #72

Open ricamgar opened 5 years ago

ricamgar commented 5 years ago

Hi,

I am getting this error when trying to compress a video file with Android 9.0.

Fatal error while transcoding, this might be invalid format or bug in engine or Android.
net.ypresto.androidtranscoder.engine.InvalidOutputFormatException: Non-baseline AVC video profile is not supported by Android OS, actual profile_idc: 100

With other versions it works as expected. Any idea why is this happening? Thanks

tipa commented 5 years ago

Same issue here :( Edit: I compiled the project myself, allowing the profile_idc 100 manually (instead of 66 only) and it seems to work. Would there be any sideeffects to this @ypresto or is this safe to use?

ffMathy commented 5 years ago

@tipa can you share the .jar file or show me how to do that by myself? I'm not native to Java environments.

tipa commented 5 years ago

Sure, you simply need to change this line: https://github.com/ypresto/android-transcoder/blob/e9c411c22897fad41a21c3f05f65b0dfe2fc327e/lib/src/main/java/net/ypresto/androidtranscoder/engine/MediaFormatValidator.java#L39 to if (profileIdc != PROFILE_IDC_BASELINE && profileIdc != 100) {

This is the resulting .jar lib-release.zip

ypresto commented 5 years ago

https://github.com/ypresto/android-transcoder/pull/73#issuecomment-475871771

(Main profile looks supported for now by Android itself, so we can remove restriction by checking Android version.)

ffMathy commented 5 years ago

Thank you so much @ypresto for your time - sounds like you are quite busy.

Does that mean we can remove the if statement entirely?

martinbertinat commented 5 years ago

Hi there, any updates on this?

Thanks

ricardoclipit commented 5 years ago

any update on this?

pengkobe commented 5 years ago

any update?

AlexTrotsenko commented 4 years ago

The issue seems to be fixed in the latest version of the master. While it's not perfect, you can get the latest build via JitPack as mentioned in #86.