FFmpeg-Android
FFmpeg-Android copied to clipboard
fixing ANR on large files
see https://stackoverflow.com/q/57067507/192373
- use StringBuilder to accumulate the output text
- convert it to String inside doInBackground, not on Main thread
Actually, I don't think it's always necessary to aggregate all intermediate output lines into one huge output string. In the case the output is short, and especially if onProgress() is empty, it may be OK. But for big files, this puts too much stress on the Garbage Collector, and the info is available anyways, timely: in the overridden ExecuteBinaryResponseHandler.onProgress() callback.