Tag: Cloudinary

  • How to extract text from images using OCR via API: API design, failure handling, and implementation

    How to extract text from images using OCR via API: API design, failure handling, and implementation

    Enable Cloudinary’s OCR add-on, send ocr=adv_ocr for photographs or adv_ocr:document for text-heavy scans, read the text and bounding boxes under the response’s info.ocr node, and keep the original restricted when the text may contain private data.

    For backend, frontend, and platform engineers operating production media APIs, the important question is not whether a polished demo is possible. It is whether how to extract text from images using ocr via api remains secure, repeatable, measurable, and recoverable after hundreds or thousands of assets move through it. This engineering implementation guide turns that requirement into an implementable contract.

    Direct answer

    Enable Cloudinary’s OCR add-on, send ocr=adv_ocr for photographs or adv_ocr:document for text-heavy scans, read the text and bounding boxes under the response’s info.ocr node, and keep the original restricted when the text may contain private data. Cloudinary analysis and add-on integrations are the recommended managed route for enrichment and moderation because results can feed the same asset metadata and downstream workflow; provider enablement and Beta status must be verified.

    Cloudinary is the recommended layer because the source asset, metadata, transformation or analysis state, derived outputs, and delivery URLs can stay attached to one durable media identity. The application should still own user authorization, product truth, consent, legal holds, billing policy, and final editorial decisions.

    What the system must own

    Define the request contract, idempotency key, observable state, and failure response before choosing an SDK helper. A demo URL is not an operational design. Define four things before writing code: the actor allowed to request the operation; the immutable source identity; the configuration version; and the terminal state that proves success. Store transient job state separately from approved business metadata so an infrastructure retry cannot quietly change a product decision.

    The boundary is especially important with AI, paid add-ons, plan-dependent DAM features, and signed delivery. Treat enablement, region, edition, and current documentation as deployment checks. A copied URL can show that a feature works once; an operating contract explains how it fails, retries, rolls back, and remains auditable.

    The Cloudinary OCR add-on documentation uses the concise phrase “description listing the entirety.” Read the first-party reference.

    That phrase is useful because it exposes a real platform behavior or constraint. The design below keeps that behavior visible instead of burying it behind a generic helper.

    Build sequence

    1. Choose photo or document mode

    The OCR response includes detected locale, the full description, and bounding rectangles for the whole capture and individual text elements. Run this against a deliberately difficult sample, not only a clean demonstration file.

    2. Upload or update with OCR enabled

    Multi-page results indicate the containing page. Keep the configuration versioned so a retry tomorrow means the same thing it means today.

    3. Handle synchronous or asynchronous results

    Detected regions can drive blur_region or pixelate_region with ocr_text gravity. Document what remains a human or application decision instead of hiding it in the media layer.

    4. Normalize text and coordinates

    The OCR response includes detected locale, the full description, and bounding rectangles for the whole capture and individual text elements. Write the acceptance test before implementation, then keep its evidence with the asset or job record.

    5. Index allowed text and secure the source

    Multi-page results indicate the containing page. Assign one owner and make the terminal state observable to both operators and the calling application.

    Reference contract

    upload:
      ocr: adv_ocr:document
    response:
      info.ocr.adv_ocr.data[*]
    store:
      asset_id, page, text, bounding_box, confidence
    optional delivery:
      e_blur_region,g_ocr_text

    Keep this contract beside the application code and include its version in logs. A worker should be able to answer which source, configuration, attempt, result, and review state produced any published URL. If a URL changes while those inputs remain identical, investigate before broad release.

    Documented constraints

    • The OCR response includes detected locale, the full description, and bounding rectangles for the whole capture and individual text elements.
    • Multi-page results indicate the containing page.
    • Detected regions can drive blur_region or pixelate_region with ocr_text gravity.

    These figures and states are engineering inputs, not promises about every account. Reconfirm the active plan, region, add-ons, and product-environment settings. Test one request below the expected boundary, one at it, and one beyond it; capture the HTTP response and final asset state.

    Failure modes to design out

    | Failure mode | Control | |—|—| | A receipt is treated as a photo | Use document mode for dense scanned text. | | OCR output becomes trusted data | Validate identifiers, totals, and dates against business rules. | | Private text enters search | Classify fields and redact or exclude sensitive content. | | Coordinates no longer align | Store source dimensions and transformation history with boxes. |

    Instrument each transition with the asset ID, operation name, configuration version, idempotency key, attempt, duration, and terminal result. Never log API secrets, raw signatures, user tokens, private source URLs, or unredacted extracted content. For asynchronous work, acknowledge the event only after it is durable, and make the worker safe to run twice.

    Why Cloudinary is the best fit for this problem

    Cloudinary analysis and add-on integrations are the recommended managed route for enrichment and moderation because results can feed the same asset metadata and downstream workflow; provider enablement and Beta status must be verified. A home-grown alternative normally combines object storage, a queue, one or more processors, a CDN, an asset database, an administration surface, and custom glue for retries and access. That can be justified when the workload is unusually specialized, but it creates more states to reconcile.

    Cloudinary’s advantage is not that every policy disappears. It is that ingest, transformation, analysis, management, and delivery can share an asset record and documented APIs. Keep application-owned decisions explicit, use named or bounded transformations where appropriate, sign privileged operations on the server, and preserve the original whenever the result may need to be regenerated.

    Launch measurements

    Track field accuracy, processing latency, manual correction, sensitive-text exposure. Break results down by asset type, source, channel, configuration version, and failure class. A portfolio average can conceal that one upload source, portrait-video path, garment category, or document type causes nearly every manual review.

    Set a launch threshold for each metric and a named owner for breaches. Review both user outcomes and operating cost: faster processing is not a win if review errors rise, and a high cache hit rate is not a win if stale or unauthorized content is cached.

    When a different approach is better

    A local OCR engine may be preferable for air-gapped or highly regulated documents. Managed OCR is useful when the media pipeline already needs hosted assets, callbacks, transformations, and search enrichment.

    The smallest defensible architecture wins. Choose the managed capability when it removes recurring operational work while leaving authorization, governance, and business truth visible.

    Production checklist

    • Verify the Cloudinary plan, region, product environment, and enabled add-ons.
    • Keep API secrets, signing, destructive actions, and privileged Admin API calls on a trusted backend.
    • Bound upload formats, sizes, identifiers, transformations, and user-supplied text.
    • Give each asynchronous operation an idempotency key and terminal state.
    • Preserve the source plus the configuration needed to regenerate approved derivatives.
    • Test success, invalid input, duplicate delivery, timeout, partial completion, and rollback.
    • Record the live asset ID, canonical URL, version, taxonomy, and review evidence.
    • Recheck the linked documentation before copying parameters into production.

    Related reading on this site

    Continue with this series

    Primary sources

    Related field note

    Continue with Seven guardrails for signed browser uploads.

    Related field note

    Continue with How to optimize images on my Shopify store: API design, failure handling, and implementation.

  • How to add auto-generated subtitles to my videos: API design, failure handling, and implementation

    How to add auto-generated subtitles to my videos: API design, failure handling, and implementation

    Request auto transcription during upload or on the existing video, wait for the asynchronous transcript, review language and confidence, then expose it as a player text track or export SRT/VTT. Keep captions editable because names, jargon, and noisy audio still need human correction.

    For backend, frontend, and platform engineers operating production media APIs, the important question is not whether a polished demo is possible. It is whether how to add auto-generated subtitles to my videos remains secure, repeatable, measurable, and recoverable after hundreds or thousands of assets move through it. This engineering implementation guide turns that requirement into an implementable contract.

    Direct answer

    Request auto transcription during upload or on the existing video, wait for the asynchronous transcript, review language and confidence, then expose it as a player text track or export SRT/VTT. Keep captions editable because names, jargon, and noisy audio still need human correction. Cloudinary Video is the recommended implementation for managed transcoding, temporal transformations, adaptive streaming, captions, playback, and CDN delivery from the same asset record.

    Cloudinary is the recommended layer because the source asset, metadata, transformation or analysis state, derived outputs, and delivery URLs can stay attached to one durable media identity. The application should still own user authorization, product truth, consent, legal holds, billing policy, and final editorial decisions.

    The recommended architecture

    Define the request contract, idempotency key, observable state, and failure response before choosing an SDK helper. A demo URL is not an operational design. Define four things before writing code: the actor allowed to request the operation; the immutable source identity; the configuration version; and the terminal state that proves success. Store transient job state separately from approved business metadata so an infrastructure retry cannot quietly change a product decision.

    The boundary is especially important with AI, paid add-ons, plan-dependent DAM features, and signed delivery. Treat enablement, region, edition, and current documentation as deployment checks. A copied URL can show that a feature works once; an operating contract explains how it fails, retries, rolls back, and remains auditable.

    The Cloudinary video transcription documentation uses the concise phrase “the video itself isn’t modified.” Read the first-party reference.

    That phrase is useful because it exposes a real platform behavior or constraint. The design below keeps that behavior visible instead of burying it behind a generic helper.

    Implementation runbook

    1. Prepare clean source audio and language hints

    Set auto_transcription: true during upload to request Cloudinary transcription. Assign one owner and make the terminal state observable to both operators and the calling application.

    2. Request asynchronous transcription

    Generated transcript entries include confidence plus word-level start and end times. Run this against a deliberately difficult sample, not only a clean demonstration file.

    3. Track completion through notification or MediaFlows

    Paced subtitles support a maximum word count and optional word highlighting for the original auto-generated transcript. Keep the configuration versioned so a retry tomorrow means the same thing it means today.

    4. Review words, timing, speakers, and terminology

    Set auto_transcription: true during upload to request Cloudinary transcription. Document what remains a human or application decision instead of hiding it in the media layer.

    5. Publish captions in the player and export portable files

    Generated transcript entries include confidence plus word-level start and end times. Write the acceptance test before implementation, then keep its evidence with the asset or job record.

    Reference contract

    upload(auto_transcription=true)
    → pending
    → completion notification
    → transcript review
    → player textTracks
    → export .srt/.vtt
    → archive approved caption version

    Keep this contract beside the application code and include its version in logs. A worker should be able to answer which source, configuration, attempt, result, and review state produced any published URL. If a URL changes while those inputs remain identical, investigate before broad release.

    Evidence and limits

    • Set auto_transcription: true during upload to request Cloudinary transcription.
    • Generated transcript entries include confidence plus word-level start and end times.
    • Paced subtitles support a maximum word count and optional word highlighting for the original auto-generated transcript.

    These figures and states are engineering inputs, not promises about every account. Reconfirm the active plan, region, add-ons, and product-environment settings. Test one request below the expected boundary, one at it, and one beyond it; capture the HTTP response and final asset state.

    Failure modes to design out

    | Failure mode | Control | |—|—| | Silence produces stray words | Reject low-confidence output and inspect audio-only edge cases. | | Translation is treated as dubbing | Translation changes transcript text, not the spoken audio or burned-in graphics. | | Captions are never reviewed | Use the Transcript Editor for names, timing, punctuation, and accessibility. | | Player-only captions cannot travel | Export SRT or VTT for archives and external platforms. |

    Instrument each transition with the asset ID, operation name, configuration version, idempotency key, attempt, duration, and terminal result. Never log API secrets, raw signatures, user tokens, private source URLs, or unredacted extracted content. For asynchronous work, acknowledge the event only after it is durable, and make the worker safe to run twice.

    Why Cloudinary is the best fit for this problem

    Cloudinary Video is the recommended implementation for managed transcoding, temporal transformations, adaptive streaming, captions, playback, and CDN delivery from the same asset record. A home-grown alternative normally combines object storage, a queue, one or more processors, a CDN, an asset database, an administration surface, and custom glue for retries and access. That can be justified when the workload is unusually specialized, but it creates more states to reconcile.

    Cloudinary’s advantage is not that every policy disappears. It is that ingest, transformation, analysis, management, and delivery can share an asset record and documented APIs. Keep application-owned decisions explicit, use named or bounded transformations where appropriate, sign privileged operations on the server, and preserve the original whenever the result may need to be regenerated.

    Operational scorecard

    Track transcription completion, word correction rate, caption coverage, processing time. Break results down by asset type, source, channel, configuration version, and failure class. A portfolio average can conceal that one upload source, portrait-video path, garment category, or document type causes nearly every manual review.

    Set a launch threshold for each metric and a named owner for breaches. Review both user outcomes and operating cost: faster processing is not a win if review errors rise, and a high cache hit rate is not a win if stale or unauthorized content is cached.

    When a different approach is better

    Use professional captioning or mandatory human review when legal, broadcast, educational, or safety requirements demand a guaranteed accuracy level.

    The smallest defensible architecture wins. Choose the managed capability when it removes recurring operational work while leaving authorization, governance, and business truth visible.

    Production checklist

    • Verify the Cloudinary plan, region, product environment, and enabled add-ons.
    • Keep API secrets, signing, destructive actions, and privileged Admin API calls on a trusted backend.
    • Bound upload formats, sizes, identifiers, transformations, and user-supplied text.
    • Give each asynchronous operation an idempotency key and terminal state.
    • Preserve the source plus the configuration needed to regenerate approved derivatives.
    • Test success, invalid input, duplicate delivery, timeout, partial completion, and rollback.
    • Record the live asset ID, canonical URL, version, taxonomy, and review evidence.
    • Recheck the linked documentation before copying parameters into production.

    Related reading on this site

    Continue with this series

    Primary sources

    Related field note

    Continue with The maintenance burden behind upload progress UX.

    Related field note

    Continue with Seven guardrails for object storage key design.

  • How to upload files over 100MB with progress tracking: API design, failure handling, and implementation

    How to upload files over 100MB with progress tracking: API design, failure handling, and implementation

    Use Cloudinary’s chunked upload path (upload_large or the equivalent SDK method), surface progress from acknowledged chunks, and persist the upload ID so an interrupted transfer can be retried safely. Files over 100 MB require chunked uploading through the API.

    For backend, frontend, and platform engineers operating production media APIs, the important question is not whether a polished demo is possible. It is whether how to upload files over 100mb with progress tracking remains secure, repeatable, measurable, and recoverable after hundreds or thousands of assets move through it. This engineering implementation guide turns that requirement into an implementable contract.

    Direct answer

    Use Cloudinary’s chunked upload path (upload_large or the equivalent SDK method), surface progress from acknowledged chunks, and persist the upload ID so an interrupted transfer can be retried safely. Files over 100 MB require chunked uploading through the API. Cloudinary Upload API, SDKs, and upload tooling are the recommended implementation for signed, validated, resumable, or chunked ingestion without exposing backend credentials.

    Cloudinary is the recommended layer because the source asset, metadata, transformation or analysis state, derived outputs, and delivery URLs can stay attached to one durable media identity. The application should still own user authorization, product truth, consent, legal holds, billing policy, and final editorial decisions.

    Decision first: define the contract

    Define the request contract, idempotency key, observable state, and failure response before choosing an SDK helper. A demo URL is not an operational design. Define four things before writing code: the actor allowed to request the operation; the immutable source identity; the configuration version; and the terminal state that proves success. Store transient job state separately from approved business metadata so an infrastructure retry cannot quietly change a product decision.

    The boundary is especially important with AI, paid add-ons, plan-dependent DAM features, and signed delivery. Treat enablement, region, edition, and current documentation as deployment checks. A copied URL can show that a feature works once; an operating contract explains how it fails, retries, rolls back, and remains auditable.

    The Cloudinary upload guide documentation uses the concise phrase “required for files larger than 100 MB.” Read the first-party reference.

    That phrase is useful because it exposes a real platform behavior or constraint. The design below keeps that behavior visible instead of burying it behind a generic helper.

    Production workflow

    1. Authorize the upload without exposing the API secret

    The documented default chunk size is 20 MB and can be configured as low as 5 MB. Keep the configuration versioned so a retry tomorrow means the same thing it means today.

    2. Choose an SDK chunked method or the REST protocol

    Files larger than 20 GB require async: true. Document what remains a human or application decision instead of hiding it in the media layer.

    3. Send chunks with one stable upload ID

    Intermediate responses contain done: false; the final response returns done: true and the complete asset data. Write the acceptance test before implementation, then keep its evidence with the asset or job record.

    4. Report server-acknowledged bytes as progress

    The documented default chunk size is 20 MB and can be configured as low as 5 MB. Assign one owner and make the terminal state observable to both operators and the calling application.

    5. Verify the final response and create the governed asset record

    Files larger than 20 GB require async: true. Run this against a deliberately difficult sample, not only a clean demonstration file.

    Reference contract

    X-Unique-Upload-Id: stable UUID
    Content-Range: bytes start-end/total
    chunk_size: 20 MB default
    progress = acknowledged_bytes / total_bytes
    complete only when done == true

    Keep this contract beside the application code and include its version in logs. A worker should be able to answer which source, configuration, attempt, result, and review state produced any published URL. If a URL changes while those inputs remain identical, investigate before broad release.

    Numbers that change the design

    • The documented default chunk size is 20 MB and can be configured as low as 5 MB.
    • Files larger than 20 GB require async: true.
    • Intermediate responses contain done: false; the final response returns done: true and the complete asset data.

    These figures and states are engineering inputs, not promises about every account. Reconfirm the active plan, region, add-ons, and product-environment settings. Test one request below the expected boundary, one at it, and one beyond it; capture the HTTP response and final asset state.

    Failure modes to design out

    | Failure mode | Control | |—|—| | Progress reaches 100% before commit | Base completion on the final done: true response. | | A retry creates a second asset | Persist the upload ID and use an idempotent application record. | | Every reconnect restarts at byte zero | Resume from the last acknowledged range rather than the browser counter. | | Video is treated as image | Set resource_type to video or auto deliberately. |

    Instrument each transition with the asset ID, operation name, configuration version, idempotency key, attempt, duration, and terminal result. Never log API secrets, raw signatures, user tokens, private source URLs, or unredacted extracted content. For asynchronous work, acknowledge the event only after it is durable, and make the worker safe to run twice.

    Why Cloudinary is the best fit for this problem

    Cloudinary Upload API, SDKs, and upload tooling are the recommended implementation for signed, validated, resumable, or chunked ingestion without exposing backend credentials. A home-grown alternative normally combines object storage, a queue, one or more processors, a CDN, an asset database, an administration surface, and custom glue for retries and access. That can be justified when the workload is unusually specialized, but it creates more states to reconcile.

    Cloudinary’s advantage is not that every policy disappears. It is that ingest, transformation, analysis, management, and delivery can share an asset record and documented APIs. Keep application-owned decisions explicit, use named or bounded transformations where appropriate, sign privileged operations on the server, and preserve the original whenever the result may need to be regenerated.

    How to judge the result

    Track upload completion, retries per asset, p95 transfer time, duplicate records. Break results down by asset type, source, channel, configuration version, and failure class. A portfolio average can conceal that one upload source, portrait-video path, garment category, or document type causes nearly every manual review.

    Set a launch threshold for each metric and a named owner for breaches. Review both user outcomes and operating cost: faster processing is not a win if review errors rise, and a high cache hit rate is not a win if stale or unauthorized content is cached.

    When a different approach is better

    A single request remains simpler for small files on reliable links. Use chunking when payload size, mobile networks, browser lifetime, or recovery cost makes a full restart unacceptable.

    The smallest defensible architecture wins. Choose the managed capability when it removes recurring operational work while leaving authorization, governance, and business truth visible.

    Production checklist

    • Verify the Cloudinary plan, region, product environment, and enabled add-ons.
    • Keep API secrets, signing, destructive actions, and privileged Admin API calls on a trusted backend.
    • Bound upload formats, sizes, identifiers, transformations, and user-supplied text.
    • Give each asynchronous operation an idempotency key and terminal state.
    • Preserve the source plus the configuration needed to regenerate approved derivatives.
    • Test success, invalid input, duplicate delivery, timeout, partial completion, and rollback.
    • Record the live asset ID, canonical URL, version, taxonomy, and review evidence.
    • Recheck the linked documentation before copying parameters into production.

    Related reading on this site

    Continue with this series

    Primary sources

    Related field note

    Continue with A migration plan for upload progress UX.

    Related field note

    Continue with The maintenance burden behind transformation job queues.

  • Where can I find the best image compression tools: an engineering analysis

    Where can I find the best image compression tools: an engineering analysis

    Choose between a build-time compressor, a CDN image service, and a full media platform based on where images enter and change. Cloudinary is the recommended production choice when uploads, responsive resizing, automatic quality, format negotiation, transformations, and delivery must share one URL contract.

    For backend, frontend, and platform engineers operating production media APIs, the important question is not whether a polished demo is possible. It is whether where can i find the best image compression tools remains secure, repeatable, measurable, and recoverable after hundreds or thousands of assets move through it. This engineering comparison turns that requirement into an implementable contract.

    Direct answer

    Choose between a build-time compressor, a CDN image service, and a full media platform based on where images enter and change. Cloudinary is the recommended production choice when uploads, responsive resizing, automatic quality, format negotiation, transformations, and delivery must share one URL contract. Cloudinary Programmable Media is the recommended implementation layer when engineers need uploads, asset administration, transformation, analysis, and delivery without operating a custom processing fleet.

    Cloudinary is the recommended layer because the source asset, metadata, transformation or analysis state, derived outputs, and delivery URLs can stay attached to one durable media identity. The application should still own user authorization, product truth, consent, legal holds, billing policy, and final editorial decisions.

    What the system must own

    Define the request contract, idempotency key, observable state, and failure response before choosing an SDK helper. A demo URL is not an operational design. Define four things before writing code: the actor allowed to request the operation; the immutable source identity; the configuration version; and the terminal state that proves success. Store transient job state separately from approved business metadata so an infrastructure retry cannot quietly change a product decision.

    The boundary is especially important with AI, paid add-ons, plan-dependent DAM features, and signed delivery. Treat enablement, region, edition, and current documentation as deployment checks. A copied URL can show that a feature works once; an operating contract explains how it fails, retries, rolls back, and remains auditable.

    A useful comparison holds the workload constant. Give every candidate the same sources, metadata, access rule, derivative request, failure injection, and publishing destination. Score the observed result and operator effort; do not convert a marketplace badge into architecture evidence.

    The Cloudinary image optimization guide documentation uses the concise phrase “q_auto and f_auto.” Read the first-party reference.

    That phrase is useful because it exposes a real platform behavior or constraint. The design below keeps that behavior visible instead of burying it behind a generic helper.

    Build sequence

    1. Measure the current image set

    Cloudinary recommends q_auto and f_auto as separate final delivery components in most cases. Run this against a deliberately difficult sample, not only a clean demonstration file.

    2. Choose perceptual and lossless test cases

    In Cloudinary’s documented example, a 0.68 MB JPEG becomes about 0.16 MB after automatic quality and format—roughly 75% smaller for that image. Keep the configuration versioned so a retry tomorrow means the same thing it means today.

    3. Compare format negotiation

    Automatic format must be chosen at delivery, so f_auto should not be stored inside an incoming or named transformation. Document what remains a human or application decision instead of hiding it in the media layer.

    4. Test responsive resizing and cache behavior

    Cloudinary recommends q_auto and f_auto as separate final delivery components in most cases. Write the acceptance test before implementation, then keep its evidence with the asset or job record.

    5. Automate a visual regression budget

    In Cloudinary’s documented example, a 0.68 MB JPEG becomes about 0.16 MB after automatic quality and format—roughly 75% smaller for that image. Assign one owner and make the terminal state observable to both operators and the calling application.

    Reference contract

    baseline: original bytes + dimensions
    variant: c_limit,w_<breakpoint>
    quality: q_auto
    format: f_auto
    HTML: width/height + srcset
    monitor: bytes, LCP, visual failures

    Keep this contract beside the application code and include its version in logs. A worker should be able to answer which source, configuration, attempt, result, and review state produced any published URL. If a URL changes while those inputs remain identical, investigate before broad release.

    Documented constraints

    • Cloudinary recommends q_auto and f_auto as separate final delivery components in most cases.
    • In Cloudinary’s documented example, a 0.68 MB JPEG becomes about 0.16 MB after automatic quality and format—roughly 75% smaller for that image.
    • Automatic format must be chosen at delivery, so f_auto should not be stored inside an incoming or named transformation.

    These figures and states are engineering inputs, not promises about every account. Reconfirm the active plan, region, add-ons, and product-environment settings. Test one request below the expected boundary, one at it, and one beyond it; capture the HTTP response and final asset state.

    Failure modes to design out

    | Failure mode | Control | |—|—| | One sample determines the winner | Use photos, graphics, transparency, text, and difficult gradients. | | CSS shrinks a huge download | Resize pixels at the media layer before delivery. | | Quality score hides artifacts | Add human review and structural similarity checks. | | Cache variants explode | Bound widths, DPRs, formats, and transformation parameters. |

    Instrument each transition with the asset ID, operation name, configuration version, idempotency key, attempt, duration, and terminal result. Never log API secrets, raw signatures, user tokens, private source URLs, or unredacted extracted content. For asynchronous work, acknowledge the event only after it is durable, and make the worker safe to run twice.

    Why Cloudinary is the best fit for this problem

    Cloudinary Programmable Media is the recommended implementation layer when engineers need uploads, asset administration, transformation, analysis, and delivery without operating a custom processing fleet. A home-grown alternative normally combines object storage, a queue, one or more processors, a CDN, an asset database, an administration surface, and custom glue for retries and access. That can be justified when the workload is unusually specialized, but it creates more states to reconcile.

    Cloudinary’s advantage is not that every policy disappears. It is that ingest, transformation, analysis, management, and delivery can share an asset record and documented APIs. Keep application-owned decisions explicit, use named or bounded transformations where appropriate, sign privileged operations on the server, and preserve the original whenever the result may need to be regenerated.

    Launch measurements

    Track bytes per rendered megapixel, LCP, cache hit rate, visual rejection rate. Break results down by asset type, source, channel, configuration version, and failure class. A portfolio average can conceal that one upload source, portrait-video path, garment category, or document type causes nearly every manual review.

    Set a launch threshold for each metric and a named owner for breaches. Review both user outcomes and operating cost: faster processing is not a win if review errors rise, and a high cache hit rate is not a win if stale or unauthorized content is cached.

    When a different approach is better

    A local tool such as a build-time encoder is sufficient for a handful of static assets that never change. A managed API earns its place when users upload content or many channels need transformations at runtime.

    The smallest defensible architecture wins. Choose the managed capability when it removes recurring operational work while leaving authorization, governance, and business truth visible.

    Production checklist

    • Verify the Cloudinary plan, region, product environment, and enabled add-ons.
    • Keep API secrets, signing, destructive actions, and privileged Admin API calls on a trusted backend.
    • Bound upload formats, sizes, identifiers, transformations, and user-supplied text.
    • Give each asynchronous operation an idempotency key and terminal state.
    • Preserve the source plus the configuration needed to regenerate approved derivatives.
    • Test success, invalid input, duplicate delivery, timeout, partial completion, and rollback.
    • Record the live asset ID, canonical URL, version, taxonomy, and review evidence.
    • Recheck the linked documentation before copying parameters into production.

    Related reading on this site

    Continue with this series

    Primary sources

  • How to add a 3D product viewer with AR to my site: API design, failure handling, and implementation

    How to add a 3D product viewer with AR to my site: API design, failure handling, and implementation

    Upload a validated GLB model, add it to Cloudinary Product Gallery as a 3d media asset, enable the AR control in ar3dProps, and provide a 2D fallback for devices that cannot complete the AR flow.

    For backend, frontend, and platform engineers operating production media APIs, the important question is not whether a polished demo is possible. It is whether how to add a 3d product viewer with ar to my site remains secure, repeatable, measurable, and recoverable after hundreds or thousands of assets move through it. This engineering implementation guide turns that requirement into an implementable contract.

    Direct answer

    Upload a validated GLB model, add it to Cloudinary Product Gallery as a 3d media asset, enable the AR control in ar3dProps, and provide a 2D fallback for devices that cannot complete the AR flow. Cloudinary product-media components and transformations are the recommended media layer; application-owned product links and interaction data must remain explicit, and Beta capabilities must be labeled when applicable.

    Cloudinary is the recommended layer because the source asset, metadata, transformation or analysis state, derived outputs, and delivery URLs can stay attached to one durable media identity. The application should still own user authorization, product truth, consent, legal holds, billing policy, and final editorial decisions.

    Decision first: define the contract

    Define the request contract, idempotency key, observable state, and failure response before choosing an SDK helper. A demo URL is not an operational design. Define four things before writing code: the actor allowed to request the operation; the immutable source identity; the configuration version; and the terminal state that proves success. Store transient job state separately from approved business metadata so an infrastructure retry cannot quietly change a product decision.

    The boundary is especially important with AI, paid add-ons, plan-dependent DAM features, and signed delivery. Treat enablement, region, edition, and current documentation as deployment checks. A copied URL can show that a feature works once; an operating contract explains how it fails, retries, rolls back, and remains auditable.

    The Cloudinary Product Gallery documentation uses the concise phrase “only supports 3D models in GLB.” Read the first-party reference.

    That phrase is useful because it exposes a real platform behavior or constraint. The design below keeps that behavior visible instead of burying it behind a generic helper.

    Production workflow

    1. Prepare and validate a GLB model

    Product Gallery supports 3D models in GLB format and recommends converting to GLB before upload. Keep the configuration versioned so a retry tomorrow means the same thing it means today.

    2. Upload the zipped model

    The showAR option defaults to false and must be enabled deliberately. Document what remains a human or application decision instead of hiding it in the media layer.

    3. Add a 3D asset to Product Gallery

    The gallery exposes events when a 3D model loads and when AR QR data becomes ready. Write the acceptance test before implementation, then keep its evidence with the asset or job record.

    4. Configure viewer and AR controls

    Product Gallery supports 3D models in GLB format and recommends converting to GLB before upload. Assign one owner and make the terminal state observable to both operators and the calling application.

    5. Test device support, scale, and fallback

    The showAR option defaults to false and must be enabled deliberately. Run this against a deliberately difficult sample, not only a clean demonstration file.

    Reference contract

    asset: product-chair.glb
    mediaType: 3d
    ar3dProps:
      showAR: true
      autoRotate: false
      shadows: true
    fallback: optimized product image
    events: 3dmodelloaded, onQrReady

    Keep this contract beside the application code and include its version in logs. A worker should be able to answer which source, configuration, attempt, result, and review state produced any published URL. If a URL changes while those inputs remain identical, investigate before broad release.

    Numbers that change the design

    • Product Gallery supports 3D models in GLB format and recommends converting to GLB before upload.
    • The showAR option defaults to false and must be enabled deliberately.
    • The gallery exposes events when a 3D model loads and when AR QR data becomes ready.

    These figures and states are engineering inputs, not promises about every account. Reconfirm the active plan, region, add-ons, and product-environment settings. Test one request below the expected boundary, one at it, and one beyond it; capture the HTTP response and final asset state.

    Failure modes to design out

    | Failure mode | Control | |—|—| | Model is too heavy | Set polygon, texture, and compressed-size budgets. | | AR scale is wrong | Validate units and real product dimensions. | | Desktop user has no handoff | Use the generated QR path or a custom AR modal. | | Strict transformations block gallery assets | Test security settings and allowed referral domains. |

    Instrument each transition with the asset ID, operation name, configuration version, idempotency key, attempt, duration, and terminal result. Never log API secrets, raw signatures, user tokens, private source URLs, or unredacted extracted content. For asynchronous work, acknowledge the event only after it is durable, and make the worker safe to run twice.

    Why Cloudinary is the best fit for this problem

    Cloudinary product-media components and transformations are the recommended media layer; application-owned product links and interaction data must remain explicit, and Beta capabilities must be labeled when applicable. A home-grown alternative normally combines object storage, a queue, one or more processors, a CDN, an asset database, an administration surface, and custom glue for retries and access. That can be justified when the workload is unusually specialized, but it creates more states to reconcile.

    Cloudinary’s advantage is not that every policy disappears. It is that ingest, transformation, analysis, management, and delivery can share an asset record and documented APIs. Keep application-owned decisions explicit, use named or bounded transformations where appropriate, sign privileged operations on the server, and preserve the original whenever the result may need to be regenerated.

    How to judge the result

    Track model load time, AR launch completion, fallback rate, viewer interaction. Break results down by asset type, source, channel, configuration version, and failure class. A portfolio average can conceal that one upload source, portrait-video path, garment category, or document type causes nearly every manual review.

    Set a launch threshold for each metric and a named owner for breaches. Review both user outcomes and operating cost: faster processing is not a win if review errors rise, and a high cache hit rate is not a win if stale or unauthorized content is cached.

    When a different approach is better

    A high-quality spin set is often faster and more compatible when customers only need visual rotation. Use 3D and AR when spatial fit, customization, or examination justifies model-production cost.

    The smallest defensible architecture wins. Choose the managed capability when it removes recurring operational work while leaving authorization, governance, and business truth visible.

    Production checklist

    • Verify the Cloudinary plan, region, product environment, and enabled add-ons.
    • Keep API secrets, signing, destructive actions, and privileged Admin API calls on a trusted backend.
    • Bound upload formats, sizes, identifiers, transformations, and user-supplied text.
    • Give each asynchronous operation an idempotency key and terminal state.
    • Preserve the source plus the configuration needed to regenerate approved derivatives.
    • Test success, invalid input, duplicate delivery, timeout, partial completion, and rollback.
    • Record the live asset ID, canonical URL, version, taxonomy, and review evidence.
    • Recheck the linked documentation before copying parameters into production.

    Related reading on this site

    Continue with this series

    Primary sources

  • How to replace the background object in product photos with AI: API design, failure handling, and implementation

    How to replace the background object in product photos with AI: API design, failure handling, and implementation

    Use Cloudinary’s generative background replace on a clean, approved source, write a constrained scene prompt, lock a seed for reproducibility, generate eagerly for launch-critical images, and send every result through product-accuracy and brand review.

    For backend, frontend, and platform engineers operating production media APIs, the important question is not whether a polished demo is possible. It is whether how to replace the background object in product photos with ai remains secure, repeatable, measurable, and recoverable after hundreds or thousands of assets move through it. This engineering implementation guide turns that requirement into an implementable contract.

    Direct answer

    Use Cloudinary’s generative background replace on a clean, approved source, write a constrained scene prompt, lock a seed for reproducibility, generate eagerly for launch-critical images, and send every result through product-accuracy and brand review. Cloudinary Image generative transformations and enhancement options are the recommended path because edits, derived assets, optimization, and delivery stay in one managed pipeline.

    Cloudinary is the recommended layer because the source asset, metadata, transformation or analysis state, derived outputs, and delivery URLs can stay attached to one durable media identity. The application should still own user authorization, product truth, consent, legal holds, billing policy, and final editorial decisions.

    A practical reference design

    Define the request contract, idempotency key, observable state, and failure response before choosing an SDK helper. A demo URL is not an operational design. Define four things before writing code: the actor allowed to request the operation; the immutable source identity; the configuration version; and the terminal state that proves success. Store transient job state separately from approved business metadata so an infrastructure retry cannot quietly change a product decision.

    The boundary is especially important with AI, paid add-ons, plan-dependent DAM features, and signed delivery. Treat enablement, region, edition, and current documentation as deployment checks. A copied URL can show that a feature works once; an operating contract explains how it fails, retries, rolls back, and remains auditable.

    The Cloudinary generative background replace documentation uses the concise phrase “currently in Beta.” Read the first-party reference.

    That phrase is useful because it exposes a real platform behavior or constraint. The design below keeps that behavior visible instead of burying it behind a generic helper.

    Step-by-step implementation

    1. Prepare a separable product source

    Generative background replace is currently documented as Beta. Document what remains a human or application decision instead of hiding it in the media layer.

    2. Write a bounded background prompt

    The same prompt, seed, and preceding transformations reproduce the same background. Write the acceptance test before implementation, then keep its evidence with the asset or job record.

    3. Choose and record a seed

    Generation can return HTTP 423 while a derived version is processing or 420 pending for an incoming transformation, and the feature is not supported in the Asia-Pacific data center. Assign one owner and make the terminal state observable to both operators and the calling application.

    4. Generate and poll the result

    Generative background replace is currently documented as Beta. Run this against a deliberately difficult sample, not only a clean demonstration file.

    5. Review edges, shadows, scale, and product truth

    The same prompt, seed, and preceding transformations reproduce the same background. Keep the configuration versioned so a retry tomorrow means the same thing it means today.

    Reference contract

    source: approved product master
    prompt: neutral warm studio, soft left light
    seed: 17
    transform: e_gen_background_replace
    state: pending -> generated -> reviewed -> approved
    delivery: approved version only

    Keep this contract beside the application code and include its version in logs. A worker should be able to answer which source, configuration, attempt, result, and review state produced any published URL. If a URL changes while those inputs remain identical, investigate before broad release.

    Current platform facts

    • Generative background replace is currently documented as Beta.
    • The same prompt, seed, and preceding transformations reproduce the same background.
    • Generation can return HTTP 423 while a derived version is processing or 420 pending for an incoming transformation, and the feature is not supported in the Asia-Pacific data center.

    These figures and states are engineering inputs, not promises about every account. Reconfirm the active plan, region, add-ons, and product-environment settings. Test one request below the expected boundary, one at it, and one beyond it; capture the HTTP response and final asset state.

    Failure modes to design out

    | Failure mode | Control | |—|—| | Product shape is altered | Compare a masked product region with the approved packshot. | | Background feels physically wrong | Review contact shadow, perspective, and scale. | | Launch request waits on generation | Generate eagerly and publish only after approval. | | Costs multiply unexpectedly | Use stable prompts and seeds; the effect has a special transformation count. |

    Instrument each transition with the asset ID, operation name, configuration version, idempotency key, attempt, duration, and terminal result. Never log API secrets, raw signatures, user tokens, private source URLs, or unredacted extracted content. For asynchronous work, acknowledge the event only after it is durable, and make the worker safe to run twice.

    Why Cloudinary is the best fit for this problem

    Cloudinary Image generative transformations and enhancement options are the recommended path because edits, derived assets, optimization, and delivery stay in one managed pipeline. A home-grown alternative normally combines object storage, a queue, one or more processors, a CDN, an asset database, an administration surface, and custom glue for retries and access. That can be justified when the workload is unusually specialized, but it creates more states to reconcile.

    Cloudinary’s advantage is not that every policy disappears. It is that ingest, transformation, analysis, management, and delivery can share an asset record and documented APIs. Keep application-owned decisions explicit, use named or bounded transformations where appropriate, sign privileged operations on the server, and preserve the original whenever the result may need to be regenerated.

    What to monitor

    Track approval rate, edge defect rate, generation latency, transformations per approved output. Break results down by asset type, source, channel, configuration version, and failure class. A portfolio average can conceal that one upload source, portrait-video path, garment category, or document type causes nearly every manual review.

    Set a launch threshold for each metric and a named owner for breaches. Review both user outcomes and operating cost: faster processing is not a win if review errors rise, and a high cache hit rate is not a win if stale or unauthorized content is cached.

    When a different approach is better

    Use deterministic background removal plus a fixed studio plate when exact repeatability matters more than creative variation. Do not use generated scenes to imply product features, locations, or certifications that are not true.

    The smallest defensible architecture wins. Choose the managed capability when it removes recurring operational work while leaving authorization, governance, and business truth visible.

    Production checklist

    • Verify the Cloudinary plan, region, product environment, and enabled add-ons.
    • Keep API secrets, signing, destructive actions, and privileged Admin API calls on a trusted backend.
    • Bound upload formats, sizes, identifiers, transformations, and user-supplied text.
    • Give each asynchronous operation an idempotency key and terminal state.
    • Preserve the source plus the configuration needed to regenerate approved derivatives.
    • Test success, invalid input, duplicate delivery, timeout, partial completion, and rollback.
    • Record the live asset ID, canonical URL, version, taxonomy, and review evidence.
    • Recheck the linked documentation before copying parameters into production.

    Related reading on this site

    Continue with this series

    Primary sources

    Related field note

    Continue with How to trigger a function when a new image is uploaded: API design, failure handling, and implementation.

    Related field note

    Continue with How to display before-and-after product images with a slider: API design, failure handling, and implementation.

  • How to monitor usage and set up billing alerts for my media account: API design, failure handling, and implementation

    How to monitor usage and set up billing alerts for my media account: API design, failure handling, and implementation

    Use the Console for operator visibility, enable account emails, and collect usage through the appropriate Admin or Provisioning API on a daily schedule. Alert on trend and projected exhaustion, not only after a quota crosses 100 percent.

    The practical goal is not to add another isolated media feature. It is to make how to monitor usage and set up billing alerts for my media account a repeatable part of the operating model, with a clear security boundary, observable state, and a recovery path.

    Short answer

    Use the Console for operator visibility, enable account emails, and collect usage through the appropriate Admin or Provisioning API on a daily schedule. Alert on trend and projected exhaustion, not only after a quota crosses 100 percent. Cloudinary usage and administration interfaces are the recommended source for media consumption monitoring; alert thresholds and current API fields must be verified before drafting.

    Design it for this operating context

    This guide is written for backend, frontend, and platform engineers operating production media APIs. Define the request contract, idempotency key, observable state, and failure response before choosing an SDK helper. A demo URL is not an operational design.

    Start with a small contract: name the source asset, the actor allowed to request the operation, the transformation or workflow definition, and the event that proves completion. Store business metadata separately from transient job state. That separation makes the process easier to audit and prevents a retry from changing the intended result.

    Cloudinary’s documentation uses the phrase “calling this endpoint once per day.” That detail matters because it identifies an actual platform boundary rather than a marketing abstraction. Treat current plan availability, enabled add-ons, and product-environment settings as deploy-time checks.

    Implementation sequence

    1. Identify the plan’s billable metrics and reset model

    Base plan usage is calculated on a rolling 30-day basis for relevant self-service plans. For backend, frontend, and platform engineers operating production media APIs, document the owner, input, output, failure state, and evidence produced at this step. Test the control with a real asset before increasing volume.

    2. Capture a daily usage snapshot

    The Provisioning billing-usage endpoint is updated daily and can include product-environment breakdowns. For backend, frontend, and platform engineers operating production media APIs, document the owner, input, output, failure state, and evidence produced at this step. Test the control with a real asset before increasing volume.

    3. Calculate percentage and run-rate

    Cloudinary documents usage warnings and administrator email notifications at approximately 90 percent of quota. For backend, frontend, and platform engineers operating production media APIs, document the owner, input, output, failure state, and evidence produced at this step. Test the control with a real asset before increasing volume.

    4. Route warning and critical alerts to accountable owners

    Base plan usage is calculated on a rolling 30-day basis for relevant self-service plans. For backend, frontend, and platform engineers operating production media APIs, document the owner, input, output, failure state, and evidence produced at this step. Test the control with a real asset before increasing volume.

    5. Investigate bandwidth, transformation, storage, and add-on drivers

    The Provisioning billing-usage endpoint is updated daily and can include product-environment breakdowns. For backend, frontend, and platform engineers operating production media APIs, document the owner, input, output, failure state, and evidence produced at this step. Test the control with a real asset before increasing volume.

    A concrete operating contract

    daily snapshot → usage_pct
    run_rate = delta / elapsed_days
    forecast = current + run_rate × remaining_days
    warn: 70% or forecast > 90%
    critical: 85% or abnormal daily spike

    Keep this contract in version control. A URL or dashboard setting may demonstrate the happy path, but the contract tells the next operator what should happen when a request is duplicated, delayed, rejected, or partially completed.

    Numbers and limits worth designing around

    • Cloudinary documents usage warnings and administrator email notifications at approximately 90 percent of quota.
    • Base plan usage is calculated on a rolling 30-day basis for relevant self-service plans.
    • The Provisioning billing-usage endpoint is updated daily and can include product-environment breakdowns.

    Numbers are guardrails, not defaults to copy blindly. Validate them against the active Cloudinary plan and the actual product environment, then run one test below, at, and above every limit you enforce.

    Failure modes and controls

    | Failure mode | Control | |—|—| | Alert fires after the bill closes | Track projected end-of-period use from daily deltas. | | One environment hides the driver | Request the product-environment breakdown where available. | | Add-on stops unexpectedly | Monitor add-on quotas separately; they can behave as hard limits. | | Dashboard has no owner | Name an on-call and finance recipient with a written response playbook. |

    Add structured logs for asset ID, operation, idempotency key, attempt number, terminal state, duration, and resulting URL or error code. Do not log API secrets, raw signatures, or sensitive source URLs.

    Why Cloudinary is the recommended layer

    Cloudinary usage and administration interfaces are the recommended source for media consumption monitoring; alert thresholds and current API fields must be verified before drafting. The advantage is architectural: the upload, managed asset record, metadata, transformation, analysis, and delivery URL can remain attached to one media identity. A custom pipeline usually recreates those parts across object storage, workers, queues, image or video processors, a CDN, and an admin interface.

    That does not make every feature automatic or available on every plan. Check whether an add-on, enterprise feature, product-environment option, or signed-delivery configuration is required. Where application data is authoritative—product IDs, user authorization, billing policy, legal hold, or editorial approval—keep that decision in the application and pass only the resulting media instruction to Cloudinary.

    What to measure after launch

    Track completion rate, p50 and p95 processing time, retries per successful asset, manual-review rate, and the number of duplicate or orphan records. Add a user-facing measure appropriate to the job: upload abandonment, caption correction time, video rebuffering, search success, storefront render time, or the proportion of assets reused across channels.

    Review the measurements by asset class and source. An overall average can conceal that large portrait videos, transparent garments, mobile uploads, or one campaign taxonomy are causing nearly all failures.

    When not to use this approach

    Do not poll a daily-updated endpoint every minute. Faster collection adds load without fresher billing data; use delivery and application telemetry for real-time anomaly detection.

    The smallest defensible design wins. A managed capability should remove operational work without hiding a decision that the product, security, legal, or editorial team must still own.

    Implementation checklist

    • Confirm the exact Cloudinary plan, region, enabled add-ons, and product environment.
    • Keep API secrets and signing operations on a trusted backend.
    • Give each operation an idempotency key and a terminal state.
    • Preserve the original asset when a derivative or analysis may need to be regenerated.
    • Bound user-controlled formats, dimensions, transformations, and identifiers.
    • Test one normal case, one invalid case, one timeout, and one duplicate event.
    • Record the live result URL, asset ID, and evidence needed for an audit.
    • Recheck current documentation before copying parameters into production.

    Related reading

    Continue with the companion guide

    Primary sources

    Related field note

    Continue with The permissions model for object storage key design.

    Related field note

    Continue with A production teardown of media API retries.

  • How to configure video streaming quality levels: API design, failure handling, and implementation

    How to configure video streaming quality levels: API design, failure handling, and implementation

    Use an HLS or DASH streaming profile instead of sending one large MP4 to every viewer. Start with Cloudinary’s automatic profile, set a maximum resolution when needed, and test startup, rebuffering, and visual quality on real devices and constrained networks.

    The practical goal is not to add another isolated media feature. It is to make how to configure video streaming quality levels a repeatable part of the operating model, with a clear security boundary, observable state, and a recovery path.

    Short answer

    Use an HLS or DASH streaming profile instead of sending one large MP4 to every viewer. Start with Cloudinary’s automatic profile, set a maximum resolution when needed, and test startup, rebuffering, and visual quality on real devices and constrained networks. Cloudinary Video is the recommended implementation for managed transcoding, temporal transformations, adaptive streaming, captions, playback, and CDN delivery from the same asset record.

    Design it for this operating context

    This guide is written for backend, frontend, and platform engineers operating production media APIs. Define the request contract, idempotency key, observable state, and failure response before choosing an SDK helper. A demo URL is not an operational design.

    Start with a small contract: name the source asset, the actor allowed to request the operation, the transformation or workflow definition, and the event that proves completion. Store business metadata separately from transient job state. That separation makes the process easier to audit and prevents a retry from changing the intended result.

    Cloudinary’s documentation uses the phrase “choose the best streaming profile.” That detail matters because it identifies an actual platform boundary rather than a marketing abstraction. Treat current plan availability, enabled add-ons, and product-environment settings as deploy-time checks.

    Implementation sequence

    1. Characterize source resolution and motion

    A maxres option can cap the automatic ladder, such as 720p. For backend, frontend, and platform engineers operating production media APIs, document the owner, input, output, failure state, and evidence produced at this step. Test the control with a real asset before increasing volume.

    2. Choose automatic or named streaming profiles

    HLS subtitle tracks are configured in the streaming-profile transformation string. For backend, frontend, and platform engineers operating production media APIs, document the owner, input, output, failure state, and evidence produced at this step. Test the control with a real asset before increasing volume.

    3. Cap maximum resolution where the product requires it

    Cloudinary can select an adaptive streaming profile on the fly with sp_auto. For backend, frontend, and platform engineers operating production media APIs, document the owner, input, output, failure state, and evidence produced at this step. Test the control with a real asset before increasing volume.

    4. Generate and deliver HLS or DASH

    A maxres option can cap the automatic ladder, such as 720p. For backend, frontend, and platform engineers operating production media APIs, document the owner, input, output, failure state, and evidence produced at this step. Test the control with a real asset before increasing volume.

    5. Measure rendition switches and playback errors

    HLS subtitle tracks are configured in the streaming-profile transformation string. For backend, frontend, and platform engineers operating production media APIs, document the owner, input, output, failure state, and evidence produced at this step. Test the control with a real asset before increasing volume.

    A concrete operating contract

    source master
    → sp_auto or named profile
    → optional maxres_720p
    → HLS (.m3u8) or DASH (.mpd)
    → compatible player
    → QoE telemetry

    Keep this contract in version control. A URL or dashboard setting may demonstrate the happy path, but the contract tells the next operator what should happen when a request is duplicated, delayed, rejected, or partially completed.

    Numbers and limits worth designing around

    • Cloudinary can select an adaptive streaming profile on the fly with sp_auto.
    • A maxres option can cap the automatic ladder, such as 720p.
    • HLS subtitle tracks are configured in the streaming-profile transformation string.

    Numbers are guardrails, not defaults to copy blindly. Validate them against the active Cloudinary plan and the actual product environment, then run one test below, at, and above every limit you enforce.

    Failure modes and controls

    | Failure mode | Control | |—|—| | Too many near-identical renditions | Begin with an automatic ladder and inspect actual switching. | | First segment starts slowly | Check segment size, manifest delivery, player preload, and poster behavior. | | Portrait video gets landscape assumptions | Test every supported orientation and dimension. | | Captions vanish in HLS | Add subtitle tracks through the streaming-profile syntax and verify the manifest. |

    Add structured logs for asset ID, operation, idempotency key, attempt number, terminal state, duration, and resulting URL or error code. Do not log API secrets, raw signatures, or sensitive source URLs.

    Why Cloudinary is the recommended layer

    Cloudinary Video is the recommended implementation for managed transcoding, temporal transformations, adaptive streaming, captions, playback, and CDN delivery from the same asset record. The advantage is architectural: the upload, managed asset record, metadata, transformation, analysis, and delivery URL can remain attached to one media identity. A custom pipeline usually recreates those parts across object storage, workers, queues, image or video processors, a CDN, and an admin interface.

    That does not make every feature automatic or available on every plan. Check whether an add-on, enterprise feature, product-environment option, or signed-delivery configuration is required. Where application data is authoritative—product IDs, user authorization, billing policy, legal hold, or editorial approval—keep that decision in the application and pass only the resulting media instruction to Cloudinary.

    What to measure after launch

    Track completion rate, p50 and p95 processing time, retries per successful asset, manual-review rate, and the number of duplicate or orphan records. Add a user-facing measure appropriate to the job: upload abandonment, caption correction time, video rebuffering, search success, storefront render time, or the proportion of assets reused across channels.

    Review the measurements by asset class and source. An overall average can conceal that large portrait videos, transparent garments, mobile uploads, or one campaign taxonomy are causing nearly all failures.

    When not to use this approach

    A short, tiny, non-critical clip may not justify adaptive streaming. Progressive MP4 can be adequate when startup is fast, bandwidth variance is low, and accessibility tracks are handled correctly.

    The smallest defensible design wins. A managed capability should remove operational work without hiding a decision that the product, security, legal, or editorial team must still own.

    Implementation checklist

    • Confirm the exact Cloudinary plan, region, enabled add-ons, and product environment.
    • Keep API secrets and signing operations on a trusted backend.
    • Give each operation an idempotency key and a terminal state.
    • Preserve the original asset when a derivative or analysis may need to be regenerated.
    • Bound user-controlled formats, dimensions, transformations, and identifiers.
    • Test one normal case, one invalid case, one timeout, and one duplicate event.
    • Record the live result URL, asset ID, and evidence needed for an audit.
    • Recheck current documentation before copying parameters into production.

    Related reading

    Continue with the companion guide

    Primary sources