Repository navigation
feat(teletext): Add multi-page extraction with separate output files (#665) - #1886
Merged
Merged
Conversation
…665) Implement support for extracting multiple teletext pages simultaneously, with each page output to a separate file. Changes: - Support multiple --tpage arguments (e.g., --tpage 397 --tpage 398) - Create separate output files per page with _pNNN suffix (e.g., output_p397.srt, output_p398.srt) - Maintain backward compatibility for single-page extraction (no suffix) - Add per-page SRT counters for correct subtitle numbering - Fix BCD to decimal page number conversion in telxcc.c - Add --tpages-all mode support for auto-detecting all pages Tested with 21 teletext samples from the sample platform, all passing. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
…heck 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
The page update logic at line 1029-1035 was incorrectly updating tlt_config.page for all accepted pages, even in single-page auto-detect mode. This caused the auto-detect logic at line 979 to be bypassed because the first packet (even with an invalid page number like 0xFF) would set tlt_config.page, preventing proper auto-detection. The fix restricts the page update to multi-page mode only. In single-page mode, tlt_config.page is set exclusively by: 1. User specification (--tpage option) 2. Auto-detect logic (first valid subtitle page found) This fixes regression in SP Test 76 which uses sample 8c1615c1a84d4b9b34134bde8085214bb93305407e935edcdfd4c2fc522c215f.mpg with --autoprogram --out=ttxt --latin1. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Collaborator
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit d573548...:
Congratulations: Merging this PR would fix the following tests:
All tests passing on the master branch were passed completely. Check the result page for more info. |
6 of 9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements multi-page teletext extraction as requested in issue #665. Users can now extract multiple teletext pages simultaneously, with each page output to a separate file.
New Features
--tpagearguments: Specify multiple teletext pages using repeated--tpageflags_pNNNsuffixoutput_p397.srt- Page 397 subtitlesoutput_p398.srt- Page 398 subtitles--tpageargument) works exactly as before, without any suffix--tpages-allsupport: Auto-detect and extract all available teletext pages (up to 8)Implementation Details
user_pagesvector to teletext config to store multiple requested pagesencoder_ctxwith on-demand file creationtelxcc.cfor correct file namingMAX_TLT_PAGES_EXTRACT)Files Changed
src/rust/src/args.rs--tpageto accept multiple values viaclap::ArgAction::Appendsrc/rust/src/parser.rsVec<u16>for multiple pages, populateuser_pagessrc/rust/lib_ccxr/src/teletext.rsuser_pagesfield toTeletextConfigsrc/rust/src/common.rsuser_pagesto FFI teletext config structsrc/lib_ccx/teletext.huser_pagesarray and count to C teletext configsrc/lib_ccx/ccx_encoders_common.hsrc/lib_ccx/ccx_encoders_common.cget_teletext_output(),get_teletext_srt_counter(),dinit_teletext_outputs()src/lib_ccx/ccx_encoders_srt.csrc/lib_ccx/telxcc.csrc/lib_ccx/ccx_common_structs.hteletext_pagefield tocc_subtitlestructsrc/lib_ccx/lib_ccx.hMAX_TLT_PAGES_EXTRACTconstantTesting
Test Samples Used
All samples are from the CCExtractor Sample Platform teletext section (view samples).
Multi-Page Samples (Danish TV - DR1)
5d5838bde97e2a8706890f19a1722fae97610c754518ac509acb7ff3776a29aa.mpg3b276ad8bf85741a65d8a36add8fbe990f8d11bfb2a908f2093174edced9baa0.mpgb236a0590b02f8acffa00f18f3e5d62e68e0f5f461dc5e5e428cca3ebc0be7c5.mpgSingle-Page Samples
44c45593fb32e475fe5295046d97796b32ac00289ec4369bb216d1c705804f1a.mpgb8c55aa2e9d6882b3d5f1fa57f3bb63fc8bf39a45bad42c0d5e5de1f2fbdf2e7.mpge639e5455049e9b94c89d7f2917d91c349b9eb8e4ced3ea5f0d5efa7fb56426e.ts--datapid 2310How to Test
Test 1: Single Page Extraction (Backward Compatibility)
Test 2: Multiple Explicit Pages
Test 3: Auto-Detect All Pages
Test 4: Specific Page with --tpage (regression test)
Test Results
All tests passed successfully:
_pNNNsuffixes, separate contentSample Output
Multiple pages extracted from
5d5838bde97e...mpg:Checklist
--tpageworks as before)dinit_teletext_outputs()Closes #665
🤖 Generated with Claude Code