mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-25 07:29:54 +00:00
[PR #2020] [FEATURE]: Add machine-readable JSON output for -out=report #2824
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/CCExtractor/ccextractor/pull/2020
Author: @x15sr71
Created: 1/14/2026
Status: 🔄 Open
Base:
master← Head:feat/json-report📝 Commits (3)
102f1fcfeat(report): add machine-readable JSON output for -out=reportcecb2bfdocs(changelog): mention JSON output support for -out=reportb0d6205chore: format Rust code and fix trailing newline📊 Changes
8 files changed (+338 additions, -1 deletions)
View changed files
📝
docs/CHANGES.TXT(+1 -0)📝
src/lib_ccx/ccx_common_option.c(+1 -0)📝
src/lib_ccx/ccx_common_option.h(+1 -0)📝
src/lib_ccx/params_dump.c(+312 -1)📝
src/rust/lib_ccxr/src/common/options.rs(+2 -0)📝
src/rust/src/args.rs(+6 -0)📝
src/rust/src/common.rs(+10 -0)📝
src/rust/src/parser.rs(+5 -0)📄 Description
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Summary
This PR implements machine-readable JSON output for the
-out=reportfeature, addressing issue #1399. Users can now generate structured reports that can be parsed with tools likejq, enabling seamless integration with automated workflows.Background
Currently, CCExtractor’s report output is human-readable text that requires custom parsing for automation. While other media analysis tools such as ffprobe and mediainfo provide JSON output, structured closed-caption reporting is not consistently available across tools or versions. This feature enables CCExtractor to expose its existing report data in a structured JSON format.
Use case: Users running CCExtractor in automated environments (e.g., CI/CD pipelines, media processing workflows) need to programmatically determine if streams contain closed captions without writing custom parsers.
Changes
-out=reportOptionExisting Text Output (-out=report)
JSON Output Structure (v1.0)
The output follows a versioned JSON report structure:
JSON output via
--report-format jsonSchema Notes
programs[]indicates which captioning systems are present (DVB, Teletext, ATSC), whilecaptions.cea_708.services[]lists active CEA-708 caption service numbers.Program Ordering:
input.pathstream.modestream.program_countstream.program_numbers[]stream.pids[]programs[].services.dvb_subtitlesprograms[].services.teletextprograms[].services.atsc_closed_captionprograms[].captions.eia_608.presentprograms[].captions.eia_608.xdsprograms[].captions.eia_608.channels.*programs[].captions.cea_708.presentprograms[].captions.cea_708.services[]programs[].video.width / heightprograms[].video.aspect_ratioprograms[].video.frame_ratecontainer.mp4.timed_text_tracksschema.*programs[].summary.*programs[].captions.presentKey Features:
-out=reportv1.0) for future extensibilityhas_any_captionssummary field reflects EIA-608 / CEA-708 only.)Technical Approach
Example Testing Commands
Field Value Formats:
aspect_ratioandframe_ratepreserve CCExtractor's internal enum formatting (e.g., "03 - 16:9", "04 - 29.97")jq '.programs[].video.aspect_ratio | split(" - ")[1]'Benefits
has_any_captionssummary field for fast EIA-608 / CEA-708 closed-caption checksNotes
strcasecmpon POSIX systems and mapsto _stricmpon Windows via platform-specific preprocessor guards.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.