Apply watermarks·续

{
  "result": {
    "uid": "8d3a5b80e7437047a0fb2761e0f7a645",
    "thumbnail": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/thumbnails/thumbnail.jpg",

"playback": {
      "hls": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/manifest/video.m3u8",
      "dash": "https://customer-f33zs165nr7gyfy4.cloudflarestream.com/6b9e68b07dfee8cc2d116e4c51d6a957/manifest/video.mpd"
    },
    "watermark": {
      "uid": "d6373709b7681caa6c48ef2d8c73690d",
      "size": 11248,
      "height": 240,
      "width": 720,
      "created": "2020-07-29T00:16:55.719265Z",
      "downloadedFrom": null,
      "name": "marketing videos",
      "opacity": 1.0,
      "padding": 0.05,
      "scale": 0.15,
      "position": "upperRight"
    }

}

Upload video with tus

tus-upload --chunk-size 5242880 \
--header Authentication 'Bearer <API_TOKEN>' \
--metadata watermark <WATERMARK_UID> \
<PATH_TO_VIDEO> https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/stream

Direct creator uploads

The video uploaded with the generated unique one-time URL will be watermarked with the profile specified.

export default {
    async fetch(request, env, ctx): Promise<Response> {
        const directUpload = await env.STREAM.createDirectUpload({
            maxDurationSeconds: 3600,
            watermark: { id: "<WATERMARK_UID>" },
        });
        return new Response(JSON.stringify({ directUpload }));
    },
} satisfies ExportedHandler<{ STREAM: StreamBinding }>;
{
    "$schema": "node_modules/wrangler/config-schema.json",
    "name": "<ENTER_WORKER_NAME>",
    "main": "src/index.ts",
    "upload_source_maps": true,
    "compatibility_date": "$today",
    "observability": {
        "enabled": true
    },
    "stream": {
        "binding": "STREAM"
    }
}

See the full Workers Stream binding API reference.

curl -X POST -H "Authorization: Bearer <API_TOKEN>" \
-H 'Content-Type: application/json' \
-d '{
  "maxDurationSeconds": 3600,
  "watermark": {
    "uid": "<WATERMARK_UID>"
  }
}' \
https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/stream/direct_upload
const client = new Cloudflare({
    apiEmail: process.env['CLOUDFLARE_EMAIL'],
    apiKey: process.env['CLOUDFLARE_API_KEY'],
});

const directUpload = await client.stream.directUpload.create({
    account_id: '<ACCOUNT_ID>',
    maxDurationSeconds: 3600,
    watermark: { uid: '<WATERMARK_UID>' },
});

See the full Stream REST API and SDK reference for details on using REST API from external applications, with pre-generated SDK's for external TypeScript, Python, or Go applications.

Example response to direct user uploads

{
  "result": {
    "uploadURL": "https://upload.videodelivery.net/c32d98dd671e4046a33183cd5b93682b",
    "uid": "c32d98dd671e4046a33183cd5b93682b",
    "watermark": {
      "uid": "d6373709b7681caa6c48ef2d8c73690d",
      "size": 11248,
      "height": 240,
      "width": 720,
      "created": "2020-07-29T00:16:55.719265Z",
      "downloadedFrom": null,
      "name": "marketing videos",
      "opacity": 1.0,
      "padding": 0.05,
      "scale": 0.15,
      "position": "upperRight"
    }
  },
  "success": true,
  "errors": [],
  "messages": []
}

watermark will be null if no watermark was specified.

Get a watermark profile

To view a watermark profile that you created:

export default {
    async fetch(request, env, ctx): Promise<Response> {
        const watermark = await env.STREAM.watermarks.get("<WATERMARK_UID>");
        return new Response(JSON.stringify({ watermark }));
    },
} satisfies ExportedHandler<{ STREAM: StreamBinding }>;
{
    "$schema": "node_modules/wrangler/config-schema.json",
    "name": "<ENTER_WORKER_NAME>",
    "main": "src/index.ts",
    "upload_source_maps": true,
    "compatibility_date": "$today",
    "observability": {
        "enabled": true
    },
    "stream": {
        "binding": "STREAM"
    }
}

See the full Workers Stream binding API reference.

curl -H "Authorization: Bearer <API_TOKEN>" \
https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/stream/watermarks/<WATERMARK_UID>
const client = new Cloudflare({
    apiEmail: process.env['CLOUDFLARE_EMAIL'],
    apiKey: process.env['CLOUDFLARE_API_KEY'],
});

const watermark = await client.stream.watermarks.get(
    '<WATERMARK_UID>',
    { account_id: '<ACCOUNT_ID>' },
);

See the full Stream REST API and SDK reference for details on using REST API from external applications, with pre-generated SDK's for external TypeScript, Python, or Go applications.

Example response to get a watermark profile

{
  "result": {
    "uid": "d6373709b7681caa6c48ef2d8c73690d",
    "size": 11248,
    "height": 240,
    "width": 720,
    "created": "2020-07-29T00:16:55.719265Z",
    "downloadedFrom": null,
    "name": "marketing videos",
    "opacity": 1.0,
    "padding": 0.05,
    "scale": 0.15,
    "position": "center"
  },
  "success": true,
  "errors": [],
  "messages": []
}

List watermark profiles

To list watermark profiles that you created:

export default {
    async fetch(request, env, ctx): Promise<Response> {
        const watermarks = await env.STREAM.watermarks.list();
        return new Response(JSON.stringify({ watermarks }));
    },
} satisfies ExportedHandler<{ STREAM: StreamBinding }>;
{
    "$schema": "node_modules/wrangler/config-schema.json",
    "name": "<ENTER_WORKER_NAME>",
    "main": "src/index.ts",
    "upload_source_maps": true,
    "compatibility_date": "$today",
    "observability": {
        "enabled": true
    },
    "stream": {
        "binding": "STREAM"
    }
}

See the full Workers Stream binding API reference.

curl -H "Authorization: Bearer <API_TOKEN>" \
https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/stream/watermarks/
const client = new Cloudflare({
    apiEmail: process.env['CLOUDFLARE_EMAIL'],
    apiKey: process.env['CLOUDFLARE_API_KEY'],
});

const watermarks = await client.stream.watermarks.list({
    account_id: '<ACCOUNT_ID>',
});

See the full Stream REST API and SDK reference for details on using REST API from external applications, with pre-generated SDK's for external TypeScript, Python, or Go applications.

Example response to list watermark profiles

{
  "result": [
    {
      "uid": "9de16afa676d64faaa7c6c4d5047e637",
      "size": 207710,
      "height": 626,
      "width": 1108,
      "created": "2020-07-29T00:23:35.918472Z",
      "downloadedFrom": null,
      "name": "marketing videos",
      "opacity": 1.0,
      "padding": 0.05,
      "scale": 0.15,
      "position": "upperLeft"
    },
    {
      "uid": "9c50cff5ab16c4aec0bcb03c44e28119",
      "size": 207710,
      "height": 626,
      "width": 1108,
      "created": "2020-07-29T00:16:46.735377Z",
      "downloadedFrom": "https://company.com/logo.png",
      "name": "internal training videos",
      "opacity": 1.0,
      "padding": 0.05,
      "scale": 0.15,
      "position": "center"
    }
  ],
  "success": true,
  "errors": [],
  "messages": []
}

Delete a watermark profile

To delete a watermark profile that you created:

export default {
    async fetch(request, env, ctx): Promise<Response> {
        await env.STREAM.watermarks.delete("<WATERMARK_UID>");
        return new Response(JSON.stringify({ success: true }));
    },
} satisfies ExportedHandler<{ STREAM: StreamBinding }>;
{
    "$schema": "node_modules/wrangler/config-schema.json",
    "name": "<ENTER_WORKER_NAME>",
    "main": "src/index.ts",
    "upload_source_maps": true,
    "compatibility_date": "$today",
    "observability": {
        "enabled": true
    },
    "stream": {
        "binding": "STREAM"
    }
}

See the full Workers Stream binding API reference.

curl -X DELETE -H 'Authorization: Bearer <API_TOKEN>' \
https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/stream/watermarks/<WATERMARK_UID>
const client = new Cloudflare({
    apiEmail: process.env['CLOUDFLARE_EMAIL'],
    apiKey: process.env['CLOUDFLARE_API_KEY'],
});

await client.stream.watermarks.delete(
    '<WATERMARK_UID>',
    { account_id: '<ACCOUNT_ID>' },
);

See the full Stream REST API and SDK reference for details on using REST API from external applications, with pre-generated SDK's for external TypeScript, Python, or Go applications.

If the operation was successful, it will return a success response:

{
  "result": "",
  "success": true,
  "errors": [],
  "messages": []
}

Limitations

  • Once the watermark profile is created, you cannot change its parameters. If you need to edit your watermark profile, please delete it and create a new one.
  • Once the watermark is applied to a video, you cannot change the watermark without re-uploading the video to apply a different profile.
  • Once the watermark is applied to a video, deleting the watermark profile will not also remove the watermark from the video.
  • The maximum file size is 2MiB (2097152 bytes), and only PNG files are supported.

Was this helpful?

YesNo

On this page

Apply watermarks·续 - 图1Docs

{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/stream/edit-videos/applying-watermarks/#page","headline":"Apply watermarks","description":"Create watermark profiles and apply them to Cloudflare Stream video uploads via the API.","url":"https://developers.cloudflare.com/stream/edit-videos/applying-watermarks/","inLanguage":"en","image":"https://developers.cloudflare.com/stream/edit-videos/applying-watermarks/og.png?v=abc73e8ccdd1d9e1","dateModified":"2026-10-12","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}


description: Customize the Cloudflare Stream player with branding, logos, and share links. title: Add player enhancements image: https://developers.cloudflare.com/stream/edit-videos/player-enhancements/og.png?v=258caf47c7367680


Skip to content

Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/stream/llms.txt
Use this file to discover all available pages before exploring further.