---
agent:
  instructions: "Use this search API to find relevant content across this site with keywords or natural-language queries, instead of crawling individual pages. Results are returned in Markdown."
  endpoint: "https://framesfield.com/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
title: "Fix FFmpeg and Sharp Stripping C2PA Provenance Metadata"
description: "Archive untouched raw vendor files, run FFmpeg or sharp normally, and attach a fresh studio-signed C2PA manifest with c2patool referencing the untouched vendor output as a parent ingredient (-p) using a production X.509 certificate."
canonical: "https://framesfield.com/fixes/c2pa-content-credentials-stripped-by-ffmpeg-and-sharp-fix"
---

# Fix FFmpeg and Sharp Stripping C2PA Provenance Metadata

> Archive untouched raw vendor files, run FFmpeg or sharp normally, and attach a fresh studio-signed C2PA manifest with c2patool referencing the untouched vendor output as a parent ingredient (-p) using a production X.509 certificate.

- **Canonical URL:** https://framesfield.com/fixes/c2pa-content-credentials-stripped-by-ffmpeg-and-sharp-fix
- **Category:** API & Batch Pipelines
- **Error Signature:** `c2patool output: "No claim found" on exported MP4/WebP | Verify UI: "Content Credentials unavailable" or "assertion.bmffHash.mismatch" / "assertion.dataHash.mismatch" after FFmpeg or Node sharp processing`
- **Last Verified:** 2026-12-01

## Observed Symptom

Your raw AI images or video clips from Adobe Firefly or another C2PA-signing provider carry valid C2PA Content Credentials when downloaded, yet the badge disappears completely—or shows a red tamper error—as soon as your studio runs FFmpeg loudness/H.264 conform or Node sharp WebP/AVIF resizing.

## Technical Root Cause

C2PA stores cryptographically signed JUMBF metadata boxes tied to exact media byte hashes. FFmpeg drops unknown MP4 uuid/JUMBF boxes by default during transcoding, and sharp strips metadata during pixel resizing; even copying the raw JUMBF bytes intact across a re-encode invalidates the original cryptographic hash because the compressed pixels changed.

## Under the Hood

A C2PA Content Credential is not a passive EXIF caption string that survives file copying. Inside MP4/ISOBMFF files, C2PA embeds a JUMBF (JPEG Universal Metadata Box Format) superbox inside a dedicated uuid container, while PNGs use a caBX chunk, JPEGs use APP11 markers, and WebP files use a C2PA RIFF chunk. That manifest contains a cryptographic hash (c2pa.hash.bmff.v2 for MP4 or c2pa.hash.data for raster images) computed over the exact compressed media bytes and signed with the generating vendor’s X.509 private key.

When you run FFmpeg to conform audio to -14 LUFS, force 8-bit yuv420p, trim frames, or concatenate clips, FFmpeg remuxes a brand-new mdat payload and silently discards unknown JUMBF uuid boxes—even if you pass -map_metadata 0, which only forwards standard container tags like title or encoder. Likewise, Node.js sharp decodes the raw PNG into uncompressed pixels in libvips, resizes it for 640px/1280px responsive WebP/AVIF delivery, and writes a fresh bitstream. Even calling sharp().withMetadata() cannot rescue a C2PA credential because only the original private key holder can sign a hash for those original bytes, and any unaltered manifest attached to re-encoded pixels triggers an immediate hash-mismatch tamper warning.

The only cryptographically valid studio solution follows the C2PA ingredient chain-of-custody model: archive untouched raw vendor assets with their original manifests intact, perform all FFmpeg post-production and sharp image optimization normally on clean working copies, and then sign the final deliverable using the official contentauth/c2patool CLI while linking the original raw asset as a parent ingredient (-p raw_source.mp4) and declaring a c2pa.transcoded or c2pa.resized action. For web CDNs or social schedulers that strip embedded JUMBF boxes on upload, generate a matching external .c2pa sidecar file alongside the signed master.

## Before vs. After

### Broken (Broken Pipeline (Re-Encoding Over Raw Asset Drops or Breaks JUMBF Hash))

```
# FFmpeg -map_metadata 0 does NOT copy C2PA JUMBF uuid boxes
ffmpeg -y -i raw_vendor_clip.mp4 -map_metadata 0 -c:v libx264 -pix_fmt yuv420p final.mp4
c2patool final.mp4
# -> Error: No claim found (provenance chain completely lost)

# Sharp resize strips caBX/C2PA chunk (and cannot re-sign pixel hashes)
await sharp('raw_gpt_image.png').resize(1280).webp({ quality: 84 }).toFile('hero-1280.webp');
```

### Verified Fix (Verified Chain-of-Custody Pipeline (Archive Raw + Re-Sign Parent Ingredient))

```
# 1. Preserve untouched vendor asset in ./raw_vendor/ and render clean master
ffmpeg -y -i raw_vendor/vendor_shot01.mp4 -c:v libx264 -crf 18 -pix_fmt yuv420p \
  -af "loudnorm=I=-14:TP=-1.0:LRA=11" -c:a aac -b:a 192k -ar 48000 -movflags +faststart \
  dist/final_unsigned.mp4

# 2. Attach fresh studio-signed manifest linking untouched vendor file as parent ingredient
c2patool dist/final_unsigned.mp4 \
  -m c2pa/studio_manifest.json \
  -p raw_vendor/vendor_shot01.mp4 \
  -o dist/final_signed.mp4
```

Preserving the original vendor output as a C2PA parent ingredient records both the upstream AI generation claim (trainedAlgorithmicMedia) and your studio post-production step with a mathematically valid hash over the final delivery bytes.

## Copy-Paste Fix (resign-c2pa-master.sh)

```bash
#!/usr/bin/env bash
set -euo pipefail

# Usage:
#   export C2PA_SIGN_CERT="/secure/certs/studio_chain.pem"
#   export C2PA_PRIVATE_KEY="/secure/certs/studio_es256.key"
#   ./resign-c2pa-master.sh raw_vendor/source.mp4 dist/master_unsigned.mp4 dist/master_signed.mp4

RAW_PARENT="${1:?Provide untouched raw vendor file (PNG/JPG/MP4)}"
PROCESSED_IN="${2:?Provide FFmpeg or sharp processed output file}"
SIGNED_OUT="${3:?Provide destination path for signed output}"
ACTION_TYPE="${4:-c2pa.transcoded}"

command -v c2patool >/dev/null 2>&1 || {
  echo "ERROR: c2patool not found. Install via: brew install c2patool (or cargo install c2patool)"
  exit 1
}

if [[ -z "${C2PA_SIGN_CERT:-}" || -z "${C2PA_PRIVATE_KEY:-}" ]]; then
  echo "ERROR: Set C2PA_SIGN_CERT and C2PA_PRIVATE_KEY to production X.509 credentials."
  echo "Refusing to ship client deliverables signed with c2patool's untrusted dev test cert."
  exit 1
fi

echo "=== 1. Inspecting raw vendor provenance ==="
c2patool "$RAW_PARENT" | head -n 40

MANIFEST_TMP="$(mktemp /tmp/c2pa_manifest.XXXXXX.json)"
trap 'rm -f "$MANIFEST_TMP"' EXIT

cat > "$MANIFEST_TMP" <<JSON
{
  "alg": "es256",
  "private_key": "${C2PA_PRIVATE_KEY}",
  "sign_cert": "${C2PA_SIGN_CERT}",
  "ta_url": "http://timestamp.digicert.com",
  "claim_generator_info": [
    {
      "name": "Studio Post-Production Pipeline",
      "version": "1.0.0"
    }
  ],
  "assertions": [
    {
      "label": "c2pa.actions",
      "data": {
        "actions": [
          {
            "action": "${ACTION_TYPE}",
            "softwareAgent": "FFmpeg / Sharp Delivery Pipeline"
          }
        ]
      }
    }
  ]
}
JSON

echo "=== 2. Signing processed master with parent ingredient chain ==="
c2patool "$PROCESSED_IN" -m "$MANIFEST_TMP" -p "$RAW_PARENT" -o "$SIGNED_OUT" --force

echo "=== 3. Writing optional external sidecar (.c2pa) for metadata-stripping CDNs ==="
c2patool "$PROCESSED_IN" -m "$MANIFEST_TMP" -p "$RAW_PARENT" -o "$SIGNED_OUT" --sidecar --force

echo "=== 4. Verifying signed master validation_status ==="
c2patool "$SIGNED_OUT" | grep -E '"claim_generator"|"digitalSourceType"|"validation_status"|"ingredients"' -A 4 || true
```

## Step-by-Step Resolution

1. **Audit raw vendor downloads before any FFmpeg or sharp touch:** Run c2patool raw_vendor/source.mp4 immediately after downloading from Adobe Firefly or another C2PA-signing provider and move untouched originals into a read-only raw_vendor/ archive folder so original hashes remain verifiable.
2. **Run standard FFmpeg conform or sharp WebP/AVIF encoding to a staging path:** Execute your normal color grade, -14 LUFS loudness conform, yuv420p encode, or responsive sharp WebP/AVIF conversion without fighting useless -map_metadata flags, writing unsigned deliverables into a staging folder.
3. **Re-sign the final master with c2patool -p and a production ES256 certificate:** Invoke c2patool with your studio_manifest.json (pointing private_key and sign_cert at a trusted X.509 chain plus an RFC 3161 ta_url timestamp server) and -p raw_vendor/source.mp4, then verify zero validation_status hash failures before client handoff.

## Verification Check (Confirm Valid Active Manifest, Parent Ingredient & Zero Hash Errors)

```bash
c2patool dist/master_signed.mp4 | grep -E '"active_manifest"|"validation_status"|"ingredients"|"digitalSourceType"' -A 3
```

**Expected healthy output:**

```text
"active_manifest": "urn:uuid:..."
"ingredients": [ { "title": "source.mp4", ... } ]
# Zero assertion.bmffHash.mismatch or assertion.dataHash.mismatch errors in validation_status
```

## Prevention Guardrails

1. **Separate raw_vendor/ archives from dist/ delivery exports in every project:** Never run in-place FFmpeg or sharp scripts that overwrite vendor originals; preserving raw files lets you regenerate valid C2PA parent chains for every 16:9, 9:16, and WebP derivative.
2. **Block development test certificates in CI release scripts:** c2patool falls back to an untrusted self-signed test key when private_key and sign_cert are omitted—fail builds unless production signing credentials are injected via secure environment variables.
3. **Emit .c2pa sidecars whenever shipping through lossy social or image CDNs:** Many CMS uploaders and ad managers still recompress uploads and strip embedded JUMBF boxes; archiving both the embedded master and its .c2pa sidecar satisfies agency compliance audits.

## FAQs

### Can FFmpeg -c copy preserve C2PA metadata if I only trim or remux without re-encoding?

No. Even stream-copy remuxing (-c copy) rewrites MP4 moov/mdat box offsets and drops non-standard JUMBF uuid boxes, which either strips the manifest entirely or invalidates byte-range hashes. Always re-sign the output with c2patool referencing the untouched source as a parent ingredient.

### Does sharp().withMetadata() keep C2PA Content Credentials intact on WebP or AVIF?

No. sharp().withMetadata() preserves standard EXIF, XMP, and ICC color profiles, but resizing or transcoding pixels changes the file bytes and breaks cryptographic C2PA hashes. Run sharp normally and sign the final WebP/JPEG/PNG output with c2patool using the raw PNG as -p parent.

### Can I link multiple AI video clips as ingredients when editing a multi-shot commercial?

Yes. Instead of a single -p flag, generate ingredient manifests for each raw clip or list multiple ingredient objects inside studio_manifest.json so the final edited MP4 records every upstream AI shot and audio stem in its provenance tree.

### Does re-encoding in FFmpeg also remove Google SynthID watermarks?

No. C2PA is structured cryptographic file metadata inspected by c2patool, whereas Google SynthID is an imperceptible statistical watermark embedded directly inside image pixels and audio waveforms designed to survive typical cropping and H.264/WebP re-encoding.

### Why does verify.contentauthenticity.org show an unrecognized signer warning on my signed file?

That warning appears when a file is signed with c2patool’s built-in development test certificate or a self-signed certificate outside the C2PA Trust List. Obtain a production C2PA-compatible X.509 signing certificate from an approved CA (such as DigiCert or SSL.com) and configure a valid RFC 3161 ta_url.
