feat(teletext): Add multi-page extraction with separate output files (#665) #1886
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