Encoding large video file(200MB+) to base64 in Android

116 views Asked by At

Recently, I encountered a confusion which is encoding large video file to base64 in Android.Until I write down the question,haven't solved it yet. What am I do this because the server requires the client to upload files in this way, I sought help from ChatGPT,But it still cannot solve various problems that arise during the coding process, including OOM(Out of memory Exception..). What I should do? thanks.

How to resolve and avoid the OOM Exception.

1

There are 1 answers

2
sdex On

Wrap your OutputStream with Base64OutputStream:

https://developer.android.com/reference/android/util/Base64OutputStream