Saving to DigitalOcean Spaces
Introduction
This tutorial is crafted to guide you through the process of saving files to DigitalOcean Spaces, an S3-compatible object storage service that simplifies data storage and access.
By the end of this tutorial, you will be able to configure a destination object to save files to DigitalOcean Spaces, understanding the necessary parameters and the S3-compatible URL structure.
Supported Protocols
Protocol | Description |
---|---|
s3:// | DigitalOcean Spaces URL |
1Creating a Space in DigitalOcean
- Log into your DigitalOcean account and navigate to the Spaces section.
- Create a new Space, selecting the appropriate region and unique name.
2Finding Your DigitalOcean Spaces Credentials
- In your DigitalOcean dashboard, access the API section.
- Generate a new Spaces access key (access_key) and secret key (secret_key).
You can find the information about managing Administrative Access in the official DigitalOcean documentation.
3Saving Output to DigitalOcean
In order to save your outputs to your DigitalOcean Storage, define your destination object using the following structure.
Destination Object Structure
"destination": {
"url": "s3://[region].digitaloceanspaces.com/bucket/path",
"key": "access_key",
"secret": "secret_key",
"permissions": "permissions"
}
Attributes of Azure Blob Destination Object
Attribute | Description |
---|---|
url | Your DigitalOcean URL. |
key | Your DigitalOcean Spaces access key. |
secret | Your DigitalOcean Spaces secret key. |
permissions | specifies object access permissions. The default value is ‘private’ meaning the object is not publicly accessible with its URL. In case you want your objects to be accessed publicly, specify ‘public-read’ as a value for permissions. |
DigitalOcean URL Structure
The url used for your DigitalOcean Storage destination object consists of region, bucket and path. Check the examples for single file and ABR formats like HLS and DASH below:
s3://[region].digitaloceanspaces.com/[bucket]/[path]
When saving ABR outputs like HLS or DASH, please specify the path to a folder where the contents of the HLS or DASH stream should be located:
s3://[region].digitaloceanspaces.com/[bucket]/folder
URL Components
region | The region where your DigitalOcean Space is hosted (e.g., nyc3, sfo2). |
bucket | Your Space name in DigitalOcean. |
path | The path within your Space where the file will be saved. |
For an up-to-date list of all the available DigitalOcean regions refer to the official DigitalOcean documentation.
Destination Object Examples
"destination": {
"url": "s3://nyc3.digitaloceanspaces.com/my-bucket/folder/output.mp4",
"key": "myAccessKey",
"secret": "mySecretKey",
"permissions": "public-read"
}
When saving ABR outputs like HLS or DASH, please specify the path to a folder where the contents of the HLS or DASH stream should be located.
"destination": {
"url": "s3://nyc3.digitaloceanspaces.com/my-bucket/folder",
"key": "myAccessKey",
"secret": "mySecretKey",
"permissions": "public-read"
}
Considerations
- Region Selection: Choose a region closest to your users for better performance.
- S3 Compatibility: Take advantage of the S3-compatible interface for easy integration with existing tools and workflows.
- Connection Issues: Ensure that the region, bucket name, and path in the URL are correct.
- Authentication Errors: Double-check your access and secret keys for accuracy.
- Explore advanced functionalities of DigitalOcean Spaces like CDN integrations and access management.