简体   繁体   中英

Better alternative to android.utils.Base64 to convert a 10MB video to Base64 String?

What is the most efficient way to convert a 10MB video to a Base64 encoded string ? When I use android.utils.Base64, it is extremely slow at times and the app hangs.

Appreciate your help.

You can use AsyncTask or a Service in background . So you can't lock main thread. Just call your Service , do your work and self kill your Service after finish. I think best way is Service . You can find information and samples here .

这在base64 str上转换10MB视频没有任何意义...我不知道您想要什么视频字符串,但是...在base64中编码视频并再次解码,这可能需要很长时间,通常是字符串的最终大小文件大于原始视频大小。

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