[PR #1669] [CLOSED] [FEAT] Added --list-tracks option to display available tracks in media files #2377

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

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1669
Author: @RemZapCypher
Created: 2/28/2025
Status: Closed

Base: masterHead: preview_subs-inter


📝 Commits (5)

  • f5bd566 checkpoint_1
  • 1116140 added code for preview subs
  • 95b2183 Merge branch 'CCExtractor:master' into preview_subs-inter
  • ab70c12 added fix for workflow
  • 0dcadba Merge branch 'master' into preview_subs-inter

📊 Changes

15 files changed (+294 additions, -11 deletions)

View changed files

📝 docs/CHANGES.TXT (+1 -0)
📝 src/ccextractor.c (+70 -0)
📝 src/lib_ccx/ccx_common_option.h (+1 -0)
📝 src/lib_ccx/ccx_encoders_common.c (+1 -1)
📝 src/lib_ccx/file_functions.c (+5 -1)
📝 src/lib_ccx/lib_ccx.h (+1 -0)
📝 src/lib_ccx/matroska.c (+48 -2)
📝 src/lib_ccx/matroska.h (+1 -0)
📝 src/lib_ccx/mp4.c (+90 -7)
📝 src/lib_ccx/params.c (+8 -0)
📝 src/lib_ccx/ts_functions.c (+57 -0)
📝 src/rust/lib_ccxr/src/common/options.rs (+3 -0)
📝 src/rust/src/args.rs (+3 -0)
📝 src/rust/src/common.rs (+1 -0)
📝 src/rust/src/parser.rs (+4 -0)

📄 Description

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

This PR adds a new command-line option --list-tracks that allows users to list all available tracks in an input file and exit without processing the file for subtitle extraction.

When working with complex media files that contain multiple tracks, it's often difficult to know which track contains the subtitles you want to extract. This feature provides a simple way to explore the file structure before running a full extraction, making it easier to:

  • Identify which streams contain subtitle data
  • Determine the appropriate track numbers for extraction
  • Save time by avoiding trial and error with multiple extraction attempts

Implementation

  • Added a list_tracks_only flag to the options structure
  • Implemented functionality to handle the flag in processing pipeline
  • Added proper command-line argument handling in Rust wrapper
  • Placed the option in the "Options that affect what will be processed" section

Example Usage

ccextractor video.mp4 --list-tracks

This will display information about available tracks in the file rather than extracting subtitles.

Testing

The feature has been tested with various media file formats including MP4, MKV, and TS files containing multiple subtitle tracks. It correctly lists available tracks and exits without performing extraction.
Distribution Used: Fedora Linux

TS Files:

image

MKV Files:

image

MP4 Files:

image


🔄 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/1669 **Author:** [@RemZapCypher](https://github.com/RemZapCypher) **Created:** 2/28/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `preview_subs-inter` --- ### 📝 Commits (5) - [`f5bd566`](https://github.com/CCExtractor/ccextractor/commit/f5bd5663919569715c1c3c6e2ce1d9e006090abe) checkpoint_1 - [`1116140`](https://github.com/CCExtractor/ccextractor/commit/1116140cc610802d340d4f6ee2a5dd81f5aa6be5) added code for preview subs - [`95b2183`](https://github.com/CCExtractor/ccextractor/commit/95b218343d49d96c45bd113c7461f28bdb7ceb28) Merge branch 'CCExtractor:master' into preview_subs-inter - [`ab70c12`](https://github.com/CCExtractor/ccextractor/commit/ab70c12064dd3cc3184c78ed6d6a7b54cf6b89d4) added fix for workflow - [`0dcadba`](https://github.com/CCExtractor/ccextractor/commit/0dcadba90e19b3af768f62a3d825673e949c3f93) Merge branch 'master' into preview_subs-inter ### 📊 Changes **15 files changed** (+294 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `docs/CHANGES.TXT` (+1 -0) 📝 `src/ccextractor.c` (+70 -0) 📝 `src/lib_ccx/ccx_common_option.h` (+1 -0) 📝 `src/lib_ccx/ccx_encoders_common.c` (+1 -1) 📝 `src/lib_ccx/file_functions.c` (+5 -1) 📝 `src/lib_ccx/lib_ccx.h` (+1 -0) 📝 `src/lib_ccx/matroska.c` (+48 -2) 📝 `src/lib_ccx/matroska.h` (+1 -0) 📝 `src/lib_ccx/mp4.c` (+90 -7) 📝 `src/lib_ccx/params.c` (+8 -0) 📝 `src/lib_ccx/ts_functions.c` (+57 -0) 📝 `src/rust/lib_ccxr/src/common/options.rs` (+3 -0) 📝 `src/rust/src/args.rs` (+3 -0) 📝 `src/rust/src/common.rs` (+1 -0) 📝 `src/rust/src/parser.rs` (+4 -0) </details> ### 📄 Description **In raising this pull request, I confirm the following (please check boxes):** - [x] I have read and understood the [contributors guide](https://github.com/CCExtractor/ccextractor/blob/master/.github/CONTRIBUTING.md). - [x] I have checked that another pull request for this purpose does not exist. - [x] I have considered, and confirmed that this submission will be valuable to others. - [x] I accept that this submission may not be used, and the pull request closed at the will of the maintainer. - [x] I give this submission freely, and claim no ownership to its content. - [x] **I have mentioned this change in the [changelog](https://github.com/CCExtractor/ccextractor/blob/master/docs/CHANGES.TXT).** **My familiarity with the project is as follows (check one):** - [ ] I have never used CCExtractor. - [ ] I have used CCExtractor just a couple of times. - [ ] I absolutely love CCExtractor, but have not contributed previously. - [x] I am an active contributor to CCExtractor. --- This PR adds a new command-line option --list-tracks that allows users to list all available tracks in an input file and exit without processing the file for subtitle extraction. When working with complex media files that contain multiple tracks, it's often difficult to know which track contains the subtitles you want to extract. This feature provides a simple way to explore the file structure before running a full extraction, making it easier to: - Identify which streams contain subtitle data - Determine the appropriate track numbers for extraction - Save time by avoiding trial and error with multiple extraction attempts Implementation - Added a list_tracks_only flag to the options structure - Implemented functionality to handle the flag in processing pipeline - Added proper command-line argument handling in Rust wrapper - Placed the option in the "Options that affect what will be processed" section Example Usage ``` ccextractor video.mp4 --list-tracks ``` This will display information about available tracks in the file rather than extracting subtitles. # Testing The feature has been tested with various media file formats including MP4, MKV, and TS files containing multiple subtitle tracks. It correctly lists available tracks and exits without performing extraction. Distribution Used: Fedora Linux ### TS Files: ![image](https://github.com/user-attachments/assets/3d441584-f44b-4143-a280-835eb38c1efb) ### MKV Files: ![image](https://github.com/user-attachments/assets/a0af800d-00ce-4a86-ac65-67b7579c1824) ### MP4 Files: ![image](https://github.com/user-attachments/assets/9bd6c344-1335-4dc9-b19c-a4a38930874a) --- <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:21:49 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2377