Skip to main content

dvdcc

dvdcc

Put line-21 closed captions (CEA-608, CC1) into the MPEG-2 video of a DVD, without re-encoding it. Pure Python, no dependencies.

  • From a Scenarist (.scc) file: the byte pairs caption tools write are used as they are, from the frame of their timecode.
  • From subtitles (SubRip, WebVTT, ASS / SSA, text scripts; UTF-8, UTF-16 or Shift_JIS): each is sent as a pop-on caption.
    • It is loaded into the hidden memory before its time, shown at its start, and erased at its end.
    • Long lines are wrapped to 32 columns and 4 rows.
    • A caption with too much text to load in time is shown late, with a note.
  • Into the video: the captions go into the stream as the DVD's GOP user data (00 00 01 B2 'C' 'C' 01 F8), one word pair per frame. This is the data a DVD player sends to line 21.

日本語の説明は README.ja.md にあります。

Why

Plenty of tools read DVD captions back, but very few put them in. ffmpeg cannot embed .scc files. The open caption libraries that write CEA-608 target H.264 and HEVC (A/53 SEI), not the DVD's MPEG-2 user data.

Install

pip install dvdcc

A release is made by the version: when the version in pyproject.toml (and dvdcc/__init__.py) reaches main without a tag of its own, .github/workflows/release.yml runs the tests, builds the package, makes the GitHub release with its tag and publishes to PyPI (trusted publishing, environment pypi). Merging the version bump is all it takes.

Use

dvdcc video.m2v captions.scc              # in place
dvdcc video.m2v subs.srt -o captioned.m2v --offset 01;00;00;00
from dvdcc import captions

schedule, notes = captions.load("subs.srt")      # or a .scc
frames = captions.inject_file("video.m2v", schedule)

Then mux and author the disc as usual. Tell the authoring tool that the titleset has line-21 captions, so players that look find them. With dvdauthor, that is <video ... caption="field1"/>.

Limits:

  • NTSC only, since line 21 belongs to the 525-line picture.
  • 29.97 frames per second. Film with soft 3:2 pulldown counts its fields differently, so it is not supported.
  • Field 1 (CC1) only.

Tests

python -m unittest discover -s tests -t .

The tests cover:

  • the caption bytes: parity, preamble address codes, the character set;
  • pop-on timing and Scenarist parsing;
  • the user data layout;
  • with ffmpeg, captions put into a test video that ffmpeg's own caption decoder (lavfi subcc) reads back as the text at the right times;
  • with dvdauthor as well, a whole authored disc whose VOB decodes to the captions and whose IFO marks line-21 captions.

dvdcc was first written for oncemore, a DVD and Blu-ray authoring app.

Support

dvdcc is free and stays free. If it saves you time, you can support its development through GitHub Sponsors (the Sponsor button at the top of this repository). Bug reports help just as much: Issues.

The logo, colours and writing rules: docs/DESIGN.md.

License

Apache License 2.0. See LICENSE and NOTICE.

Metadata

Release files for dvdcc 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dvdcc 0.1.1
File Size Uploaded Provenance Actions
dvdcc-0.1.1.tar.gz 22.9 kB With provenance Details for dvdcc-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dvdcc 0.1.1
File Interpreter ABI Platform Actions
dvdcc-0.1.1-py3-none-any.whl Python 3 none any Details for dvdcc-0.1.1-py3-none-any.whl

Total release size: 41.0 kB

Release files / dvdcc-0.1.1.tar.gz

Download URL dvdcc-0.1.1.tar.gz
Size 22.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b1c0f2c3d82be4d7105752eca0d0efc74748e2ffd73f1ac918ea81a60a8ec350
BLAKE2b-256 checksum
How to use checksums
ee2ed22161c88bddd43106c0a080694c7f868235990cbc5d580227efee4a72ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / dvdcc-0.1.1-py3-none-any.whl

Download URL dvdcc-0.1.1-py3-none-any.whl
Size 18.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02cff064833d591109f630753c2c01b86b5daf8b38ade811526a4639272e5ddd
BLAKE2b-256 checksum
How to use checksums
18a2d814d6a06e08a8c3bf7bbf0e92420311de8e7aaf4536e52e9a35ced9457d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Security for dvdcc 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for dvdcc-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page