Skip to main content
Introducing packages.sweber.dev
All posts
Release2 min read

Witness 0.2.0 released

Witness now marks audio and video too: the IPTC digital source type in MP3, WAV, MP4, MOV and M4A files, from code or the CLI. Witness Pro 0.2.0 checks AI audio and video in your build.

By Seya Weber

Witness 0.2.0 is out. Article 50(2) of the EU AI Act asks for machine-readable marking of synthetic audio and video as well as images and text. Until now Witness only marked images. With 0.2.0, @sweberdev/witness writes the same XMP marking into sound and video files. @sweberdev/witness and @sweberdev/witness-react 0.2.0 are on npm under the MIT licence.

What is in 0.2.0

  • markMedia and readMediaMarking: write and read XMP with the IPTC digital source type, the AI system and the creation date in MP3, WAV, MP4, MOV and M4A files.
  • The marking goes where the XMP specification puts it: an ID3v2 PRIV frame for MP3, a _PMX chunk for WAV, and a uuid box at the end of MP4 files. The sound and the picture are not re-encoded, and other ID3 tags such as title and cover are kept.
  • markFile and readMarking detect images, audio and video and do the right thing, so one call covers everything a model can produce.
  • witness mark and witness inspect accept audio and video files.
  • Files that carry a C2PA manifest are left unchanged, as they are for images.

Install

npm install @sweberdev/witness@0.2.0
import { markMedia } from "@sweberdev/witness"

const { bytes, status } = markMedia(audio, { generator: "tts-model", provider: "Beispiel AG" })

The same from the command line:

npx witness mark voice/*.mp3 clips/*.mp4 --out marked --generator "tts-model"
npx witness inspect marked/*

The audio and video guide has the details, including how to mark the output of generateSpeech from the Vercel AI SDK. In the live demo you can mark your own sound file or video in the browser and download it again.

Metadata is not a watermark: re-encoding and most platforms remove it. For deepfake audio and video, Article 50(4) also asks for a visible or audible disclosure. Put a label on the player and a short spoken notice at the start of the audio.

Witness Pro 0.2.0

The Pro scanner now checks audio and video in your build. Files in folders you declare as AI-generated must carry a marking (ai-media-unmarked), and marked files played in an <audio> or <video> element need a label next to the player (ai-media-unlabelled). The transparency report counts AI audio and video. See the Witness page for the Pro edition.

Package in this post

Witness

AI notices, AI labels and machine-readable marking for Article 50 of the EU AI Act, for any web app and the Vercel AI SDK.

pnpm add @sweberdev/witness
View package

Related posts

Release

Witness 0.1.0 released

AI notices, AI labels and machine-readable marking for Article 50 of the EU AI Act: web components, React components, image and text marking and middleware for the Vercel AI SDK.

Witness
Release

Cosine 0.1.0 released

Semantic search for documentation sites that runs entirely in the browser. Keyword results on the first keystroke, ranking by meaning once the model has loaded. No server, no API key.

Cosine