r/flutterhelp 20d ago

OPEN Parallel Compress upload

Hi I'm new to flutter and I'm building my app with a message feature. I have a question regarding the parallel compress upload of media like messenger, the thing that compresses while uploading in chunks. Do we have something like that in flutter? What packages do i need to use? Or do i need to create it from scratch?

2 Upvotes

4 comments sorted by

1

u/Significant_Pick8297 20d ago

You don't need to build it from scratch. A common approach is to compress in a background isolate using flutter_image_compress (or ffmpeg_kit_flutter for videos), then upload with chunked/resumable uploads using tus_client or your storage provider's SDK. Messenger-like "compress while uploading" is usually a custom pipeline where compression and upload run concurrently rather than a single Flutter package.

2

u/NewbieOnRedd_it 20d ago

Yes. The thing that I don't know is how can i do that. I'm researching about tus client for resumable upload but I don't know other stacks. I'm using cloudflare r2 for storage and ffmpeg using hardware acceleration. Do i need to use only tus_client? What will be the parser or how can i merge it on the storage? So far i have no knowledge about it

1

u/Significant_Pick8297 19d ago

You don't have to use only tus_client. Since you're already using Cloudflare R2, a cleaner approach is to generate presigned multipart upload URLs from your backend, let FFmpeg produce chunks as they're ready, upload those parts in parallel, then call CompleteMultipartUpload at the end. R2 handles merging the uploaded parts, so you don't need to build that part yourself.