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): 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.0

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.0
File Size Uploaded Provenance Actions
dvdcc-0.1.0.tar.gz 22.6 kB With provenance Details for dvdcc-0.1.0.tar.gz

Built distribution (wheel)

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

Total release size: 40.4 kB

Release files / dvdcc-0.1.0.tar.gz

Download URL dvdcc-0.1.0.tar.gz
Size 22.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7e77fc671ee735da4d2a2d61f8e59e507ab00be6637ae569b01b9b28183ed22b
BLAKE2b-256 checksum
How to use checksums
0f553585393a939f6310e4538f2cbc33107c49471f926df5d10654a6e0b910ce
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.0-py3-none-any.whl

Download URL dvdcc-0.1.0-py3-none-any.whl
Size 17.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f23193f48308bab1839d344687a0b362eae7ec1bc772d4d5d39d8cc8f527b78
BLAKE2b-256 checksum
How to use checksums
b7343420360e688c978c388ee636e917ba18636ec1fdc925e62d1b4f06bdfb4e
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.0

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.0.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