Most efficient way to upload dozens of videos

In our app, users select many videos (10–100+) that we upload to our server in one batch. Two problems compound each other:

  1. Backgrounding: Users almost always leave the app while the batch is in flight. Uploads started with a regular URLSession get suspended.

  2. Pre-upload transcoding: To reduce upload duration and cellular data usage, we downscale/re-encode each video (via AVAssetExportSession) before upload. This is resource-intensive and unlike a background URLSession upload task can't continue once the app is suspended, so the pipeline stalls even if the uploads themselves could continue.

What's Apple's recommended design here? Is the intended pattern a background URLSession with file-based upload tasks, fed by a BGProcessingTask that drains the transcode queue opportunistically? Are there APIs we're missing, e.g. AVAssetExportSession's background-friendly options, HEVC/preferredTranscoding export presets that are cheaper, or any way to get extended runtime for the encode step (beginBackgroundTask budgets seem too short for dozens of videos)? And is there guidance on the trade-off of just uploading originals and transcoding server-side instead?

Answered by Frameworks Engineer in 893116022

Consider adopting BGContinuedProcessingTask for your workflow if the upload is definitively tied to a user action. The benefits of BGContinuedProcessingTask is that it begins processing immediately (subject to system conditions), and can continue running while your app is in the foreground or the background.

BGContinuedProcessingTask documentation: https://developer.apple.com/documentation/backgroundtasks/bgcontinuedprocessingtaskrequest

WWDC 2025 presentation: https://developer.apple.com/videos/play/wwdc2025/227

Consider adopting BGContinuedProcessingTask for your workflow if the upload is definitively tied to a user action. The benefits of BGContinuedProcessingTask is that it begins processing immediately (subject to system conditions), and can continue running while your app is in the foreground or the background.

BGContinuedProcessingTask documentation: https://developer.apple.com/documentation/backgroundtasks/bgcontinuedprocessingtaskrequest

WWDC 2025 presentation: https://developer.apple.com/videos/play/wwdc2025/227

Follow-up on BGContinuedProcessingTask: it looks like a great fit when the user explicitly starts an upload. In our case, the user opts into photo library sync once, and after that we want subsequent app launches to discover new videos since the last sync, transcode them, and upload them automatically. The recurring work is therefore user-authorized, but not tied to a fresh user action each time new content appears.

For this kind of ongoing media sync, where the user initiated the workflow once, but future uploads are triggered by newly detected content rather than an explicit upload action: What approach would you recommend?

Most efficient way to upload dozens of videos
 
 
Q