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

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

Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1876

State: closed
Merged: Yes


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

**Original Pull Request:** https://github.com/CCExtractor/ccextractor/pull/1876 **State:** closed **Merged:** Yes --- ## 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)
claunia added the pull-request label 2026-01-29 17:23:18 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2659