[PR #1876] [MERGED] fix(mp4/mkv): Add HEVC/H.265 caption extraction for MP4 and Matroska containers #2654

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

📋 Pull Request Information

Original PR: https://github.com/CCExtractor/ccextractor/pull/1876
Author: @cfsmp3
Created: 12/21/2025
Status: Merged
Merged: 12/22/2025
Merged by: @cfsmp3

Base: masterHead: fix/hevc-mp4-caption-extraction


📝 Commits (2)

  • 701271e fix(mp4): Add HEVC/H.265 caption extraction for MP4 containers
  • 44363c0 fix(mkv): Add HEVC/H.265 caption extraction for Matroska containers

📊 Changes

3 files changed (+357 additions, -11 deletions)

View changed files

📝 src/lib_ccx/matroska.c (+127 -8)
📝 src/lib_ccx/matroska.h (+4 -1)
📝 src/lib_ccx/mp4.c (+226 -2)

📄 Description

Summary

  • Adds HEVC/H.265 caption extraction support for MP4 and MKV containers
  • Fixes issue where EIA-608/708 captions embedded in HEVC SEI NAL units weren't extracted
  • Key fix: Added store_hdcc() call to flush buffered CC data after each sample/frame

MP4 Changes (mp4.c)

  • Add HEVC subtype definitions (hev1, hvc1)
  • Add process_hevc_sample() to parse HEVC NAL units and extract CC
  • Add process_hevc_track() to iterate through HEVC track samples
  • Detect and process HEVC tracks in processmp4()

MKV Changes (matroska.c/h)

  • Add hevc_codec_id constant for V_MPEGH/ISO/HEVC
  • Add hevc_track_number field to track HEVC video tracks
  • Add process_hevc_frame_mkv() with HEVC-specific NAL parsing
  • Parse HEVCDecoderConfigurationRecord in codec private data
  • Route HEVC tracks through parse_simple_block()

Test plan

  • Build completes successfully
  • MP4 HEVC extraction: 73 captions extracted correctly
  • MKV HEVC extraction: 73 captions extracted correctly (matches MP4)
  • Run regression tests on sample platform

Closes #1690

🤖 Generated with Claude Code


🔄 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/1876 **Author:** [@cfsmp3](https://github.com/cfsmp3) **Created:** 12/21/2025 **Status:** ✅ Merged **Merged:** 12/22/2025 **Merged by:** [@cfsmp3](https://github.com/cfsmp3) **Base:** `master` ← **Head:** `fix/hevc-mp4-caption-extraction` --- ### 📝 Commits (2) - [`701271e`](https://github.com/CCExtractor/ccextractor/commit/701271ec82a2f5476cc9a5583e9dcf890a27a3c0) fix(mp4): Add HEVC/H.265 caption extraction for MP4 containers - [`44363c0`](https://github.com/CCExtractor/ccextractor/commit/44363c0acd50158be2461c4fb9e4cff378c249e3) fix(mkv): Add HEVC/H.265 caption extraction for Matroska containers ### 📊 Changes **3 files changed** (+357 additions, -11 deletions) <details> <summary>View changed files</summary> 📝 `src/lib_ccx/matroska.c` (+127 -8) 📝 `src/lib_ccx/matroska.h` (+4 -1) 📝 `src/lib_ccx/mp4.c` (+226 -2) </details> ### 📄 Description ## Summary - Adds HEVC/H.265 caption extraction support for **MP4** and **MKV** containers - Fixes issue where EIA-608/708 captions embedded in HEVC SEI NAL units weren't extracted - Key fix: Added `store_hdcc()` call to flush buffered CC data after each sample/frame ### MP4 Changes (mp4.c) - Add HEVC subtype definitions (hev1, hvc1) - Add `process_hevc_sample()` to parse HEVC NAL units and extract CC - Add `process_hevc_track()` to iterate through HEVC track samples - Detect and process HEVC tracks in `processmp4()` ### MKV Changes (matroska.c/h) - Add `hevc_codec_id` constant for V_MPEGH/ISO/HEVC - Add `hevc_track_number` field to track HEVC video tracks - Add `process_hevc_frame_mkv()` with HEVC-specific NAL parsing - Parse HEVCDecoderConfigurationRecord in codec private data - Route HEVC tracks through `parse_simple_block()` ## Test plan - [x] Build completes successfully - [x] MP4 HEVC extraction: 73 captions extracted correctly - [x] MKV HEVC extraction: 73 captions extracted correctly (matches MP4) - [ ] Run regression tests on sample platform Closes #1690 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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:23:17 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2654