Use multipart uploads for local video files up to 4 GB. This method divides the file into smaller chunks for reliable uploads, especially when you need parallel chunk uploads or want to resume an interrupted transfer.
Multipart uploads create assets that you can use in different workflows.
The MultipartUploadClientWrapper class provides convenience methods that simplify multipart uploads. Use these methods for most upload scenarios.
For a complete example that demonstrates progress tracking, error handling, and batch uploads, see the multipart_uploads.py example in the SDK repository.
Description: Upload a local video file using multipart upload with automatic chunking, parallel uploads, progress tracking, and retry logic.
Function signature and example:
Returns an UploadResult object.
The UploadResult class contains the following properties:
The UploadProgress class (used in progress_callback) contains the following properties:
Description: Monitor a multipart upload by checking its status at regular intervals.
Function signature and example:
Returns an UploadStatus object.
The UploadStatus class contains the following properties:
The MultipartUploadClient class provides methods to manage multipart upload sessions. Use these methods when you need fine-grained control over the upload process.
Determine the total size of your file in bytes. You’ll need this value when creating the upload session.
Create an upload session: Call the multipart_upload.create method, providing details about your file, including its size. The response contains, among other information, the unique identifier of the asset, a list of upload URLs, and the size of each chunk in bytes.
Split your file: Use the chunk size from the response to divide your file into chunks of the specified size.
Upload chunks: Transfer each chunk to its designated presigned URL. You can upload the chunks in parallel for improved performance. Save the ETag from each upload response for progress reporting.
(Optional) Request additional URLs: Call the multipart_upload.get_additional_presigned_urls if you need URLs for remaining chunks or if existing URLs expire.
Report progress: Submit completed chunks via the multipart_upload.report_chunk_batch method in batches as chunks finish uploading. Use the ETag from each chunk upload as proof of successful transfer.
Confirm completion: The upload is complete when the multipart_upload.get_status method returns status: 'completed'. Use the asset ID from step 1 to perform additional operations on your uploaded video.
What you do next depends on your use case:
Description: This method returns a list of all incomplete multipart upload sessions in your account.
Function signature and example:
Returns a SyncPager[IncompleteUploadSummary] object that allows you to iterate through the paginated results.
The SyncPager[T] class contains the following properties and methods:
The IncompleteUploadSummary class contains the following properties:
Description: This method creates a multipart upload session for a local video file.
Supported content: Video
Upload limits: Local video files larger than 200 MB, up to 4 GB.
Additional requirements depend on your workflow:
Function signature and example:
Returns a CreateAssetUploadResponse object containing details about the upload session.
The CreateAssetUploadResponse class contains the following properties:
The PresignedUrlChunk class contains the following properties:
Create a multipart upload session
Description: This method retrieves information about an upload session, including its current status, chunk-level progress, and completion state.
Use this method to:
status = completed)uploaded_size with total_sizeYou must call this method after reporting chunk completion to confirm the upload has transitioned to the completed status before using the asset.
Function signature and example:
Returns a SyncPager[ChunkInfo] object that allows you to iterate through the paginated chunk status information.
The SyncPager[T] class contains the following properties and methods:
The ChunkInfo class contains the following properties:
Retrieve the status of an upload session
Description: This method reports successfully uploaded chunks to the platform. The platform finalizes the upload after you report all chunks.
For optimal performance, report chunks in batches and in any order.
Function signature and example:
The CompletedChunk class contains the following properties:
Returns a ReportChunkBatchResponse object containing information about the reported chunks.
The ReportChunkBatchResponse class contains the following properties:
Description: This method generates new presigned URLs for specific chunks that require uploading. Use this method in the following situations:
To specify which chunks need URLs, use the start and count parameters. For example, to generate URLs for chunks 21 to 30, use start=21 and count=10.
The response provides new URLs, each with a fresh expiration time of one hour.
Function signature and example:
Returns a RequestAdditionalPresignedUrLsResponse object containing the new presigned URLs.
The RequestAdditionalPresignedUrLsResponse class contains the following properties:
The PresignedUrlChunk class contains the following properties: