简体   繁体   中英

Is it possible to convert h265 video to h264 with resizing in Android app without the FFMPEG?

I want to convert all videos based on h265 to h264 and at the same time reduce the resolution to for example 720p to avoid working on very big resolutions and later uploading that kind of big size files.

I see docs https://developer.android.com/guide/topics/media/media-formats says that for h265 Android OS supports only decoding, not encoding.

I know that FFMPEG will solve all my problems, but including FFMPEG will increase the app size very much, I'd like to avoid that. I am trying to use currently the Android MediaCodec , but it looks like it would work fine with converting h264 to h264 but not with h265 to h264.

Do you have any ideas? I don't need to support old Android versions.

Thanks for any advice.

If you're compiling it for Android 12 or higher, you can use the built-in transcoder

Otherwise, you'll need to include a 3rd-party media transcoder library, and FFMPEG is still your best choice

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM