[PR #1836] [CLOSED] Add --split-dvb-subs to extract each DVB subtitle stream into a separate file (fixes #447) #2593

Open
opened 2026-01-29 17:22:58 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1836
Author: @Rahul-2k4
Created: 12/17/2025
Status: Closed

Base: masterHead: master


📝 Commits (7)

  • 48d633f Implement multi-stream DVB subtitle extraction (--split-dvb-subs)
  • 20421f7 Initial plan
  • 6cd26a6 Fix compiler errors in DVB multi-stream structures
  • 2b4faa7 Initial plan
  • e1b0271 Apply clang-format and rustfmt formatting fixes
  • eedaf08 Merge pull request #7 from Rahul-2k4/copilot/fix-clang-format-issues
  • b2de438 Merge branch 'CCExtractor:master' into master

📊 Changes

14 files changed (+375 additions, -5 deletions)

View changed files

📝 src/lib_ccx/ccx_common_option.c (+4 -0)
📝 src/lib_ccx/ccx_common_option.h (+4 -0)
📝 src/lib_ccx/ccx_demuxer.c (+4 -0)
📝 src/lib_ccx/ccx_demuxer.h (+20 -0)
📝 src/lib_ccx/dvb_subtitle_decoder.c (+65 -0)
📝 src/lib_ccx/dvb_subtitle_decoder.h (+38 -0)
📝 src/lib_ccx/general_loop.c (+15 -5)
📝 src/lib_ccx/lib_ccx.c (+126 -0)
📝 src/lib_ccx/lib_ccx.h (+10 -0)
📝 src/lib_ccx/ts_tables.c (+73 -0)
📝 src/rust/lib_ccxr/src/common/options.rs (+3 -0)
📝 src/rust/src/args.rs (+6 -0)
📝 src/rust/src/common.rs (+3 -0)
📝 src/rust/src/parser.rs (+4 -0)

📄 Description

Description

This PR adds support for extracting multiple DVB subtitle streams into separate output files via a new opt-in flag: --split-dvb-subs.

It resolves the long-standing request in #447, where users want CCExtractor to automatically handle transport streams containing multiple DVB subtitle tracks (e.g. multi-language broadcasts) without pre-selecting PIDs or running the tool multiple times.

Default behavior is unchanged unless the flag is explicitly enabled.

### Motivation

  • Many DVB transport streams contain more than one subtitle stream (often per language).
  • Currently, CCExtractor extracts only a single stream, which makes multi-language workflows cumbersome.
  • With --split-dvb-subs, CCExtractor:
  • Discovers all DVB subtitle streams via PMT parsing
  • Creates isolated per-PID decoder pipelines
  • Produces one output file per stream (PID or language-suffixed)
  • This makes CCExtractor significantly more convenient for real-world DVB content.

Summary of Changes

  • Added --split-dvb-subs CLI option (disabled by default)
  • Enhanced PMT parsing to discover multiple DVB subtitle streams
  • Refactored DVB subtitle decoder to be instance-safe (no static globals)
  • Introduced per-stream pipelines (decoder + timing + encoder + writer)
  • Implemented PID-based packet routing
  • Added strict option-conflict validation
  • Preserved legacy single-stream behavior

Testing

Built and tested with and without --split-dvb-subs
Verified extraction on DVB TS files containing multiple subtitle streams

Confirmed:

  • One output file per stream
  • Bit-exact legacy behavior when the flag is not used
  • Clean shutdown with proper resource cleanup

Scope / Notes

  • This PR intentionally limits scope to DVB subtitle streams only
  • Teletext multi-stream extraction is not included and can be addressed separately
  • The design is extensible for future language filtering or stream selection

Closing

I’ve tried to keep this change conservative, backward-compatible, and well-isolated from existing logic.
Feedback is very welcome I’m happy to revise or split the PR if needed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/CCExtractor/ccextractor/pull/1836 **Author:** [@Rahul-2k4](https://github.com/Rahul-2k4) **Created:** 12/17/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (7) - [`48d633f`](https://github.com/CCExtractor/ccextractor/commit/48d633f10b776ed3f98b67a5ed86affc0caa26d6) Implement multi-stream DVB subtitle extraction (--split-dvb-subs) - [`20421f7`](https://github.com/CCExtractor/ccextractor/commit/20421f74329f33b21581e29fc78f253126784061) Initial plan - [`6cd26a6`](https://github.com/CCExtractor/ccextractor/commit/6cd26a6c47903e076821f9e1b19883aaa0b3f508) Fix compiler errors in DVB multi-stream structures - [`2b4faa7`](https://github.com/CCExtractor/ccextractor/commit/2b4faa7a26d0eb94dd858a3f62906fe349b5522a) Initial plan - [`e1b0271`](https://github.com/CCExtractor/ccextractor/commit/e1b027162906e368cc540a3038c73803fd1fd5c5) Apply clang-format and rustfmt formatting fixes - [`eedaf08`](https://github.com/CCExtractor/ccextractor/commit/eedaf0889d4baf1669d0f0fec1b398349b38c0e5) Merge pull request #7 from Rahul-2k4/copilot/fix-clang-format-issues - [`b2de438`](https://github.com/CCExtractor/ccextractor/commit/b2de438b22c90217ad5615abdfe9e232734e043b) Merge branch 'CCExtractor:master' into master ### 📊 Changes **14 files changed** (+375 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `src/lib_ccx/ccx_common_option.c` (+4 -0) 📝 `src/lib_ccx/ccx_common_option.h` (+4 -0) 📝 `src/lib_ccx/ccx_demuxer.c` (+4 -0) 📝 `src/lib_ccx/ccx_demuxer.h` (+20 -0) 📝 `src/lib_ccx/dvb_subtitle_decoder.c` (+65 -0) 📝 `src/lib_ccx/dvb_subtitle_decoder.h` (+38 -0) 📝 `src/lib_ccx/general_loop.c` (+15 -5) 📝 `src/lib_ccx/lib_ccx.c` (+126 -0) 📝 `src/lib_ccx/lib_ccx.h` (+10 -0) 📝 `src/lib_ccx/ts_tables.c` (+73 -0) 📝 `src/rust/lib_ccxr/src/common/options.rs` (+3 -0) 📝 `src/rust/src/args.rs` (+6 -0) 📝 `src/rust/src/common.rs` (+3 -0) 📝 `src/rust/src/parser.rs` (+4 -0) </details> ### 📄 Description ### **Description** This PR adds support for extracting multiple DVB subtitle streams into separate output files via a new opt-in flag: --split-dvb-subs. It resolves the long-standing request in #447, where users want CCExtractor to automatically handle transport streams containing multiple DVB subtitle tracks (e.g. multi-language broadcasts) without pre-selecting PIDs or running the tool multiple times. Default behavior is unchanged unless the flag is explicitly enabled. ### **### Motivation** - Many DVB transport streams contain more than one subtitle stream (often per language). - Currently, CCExtractor extracts only a single stream, which makes multi-language workflows cumbersome. - With --split-dvb-subs, CCExtractor: - Discovers all DVB subtitle streams via PMT parsing - Creates isolated per-PID decoder pipelines - Produces one output file per stream (PID or language-suffixed) - This makes CCExtractor significantly more convenient for real-world DVB content. ### **Summary of Changes** - Added --split-dvb-subs CLI option (disabled by default) - Enhanced PMT parsing to discover multiple DVB subtitle streams - Refactored DVB subtitle decoder to be instance-safe (no static globals) - Introduced per-stream pipelines (decoder + timing + encoder + writer) - Implemented PID-based packet routing - Added strict option-conflict validation - Preserved legacy single-stream behavior ### **Testing** Built and tested with and without --split-dvb-subs Verified extraction on DVB TS files containing multiple subtitle streams ### **Confirmed**: - One output file per stream - Bit-exact legacy behavior when the flag is not used - Clean shutdown with proper resource cleanup ### **Scope / Notes** - This PR intentionally limits scope to DVB subtitle streams only - Teletext multi-stream extraction is not included and can be addressed separately - The design is extensible for future language filtering or stream selection ### Closing I’ve tried to keep this change conservative, backward-compatible, and well-isolated from existing logic. Feedback is very welcome I’m happy to revise or split the PR if needed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 17:22:58 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2593