- Move PLAN_PR1618_REIMPLEMENTATION.md to local plans/ folder
- Add plans/ to .gitignore to keep plans local
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add build_*/ pattern and linux/build_scan/ to ignore various build
output directories (build_ocr/, build_ocr_asan/, etc.)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(dvb): Multiple fixes for DVB subtitle extraction from Chinese broadcasts (#224)
This commit addresses multiple issues with DVB subtitle extraction reported in #224:
1. **PMT parsing crash fix** (ts_tables.c):
- Added minimum length check (16 bytes) to prevent out-of-bounds access
- Added bounds check before memcpy to prevent buffer overflow when section > 1021 bytes
2. **Negative subtitle timing fix** (general_loop.c):
- For DVB subtitle streams, properly initialize min_pts from audio/subtitle PTS
- This fixes the issue where all timestamps were negative (~95000 seconds off)
3. **OCR improvements** (ocr.c):
- Fixed ignore_alpha_at_edge() which could create invalid crop windows
- Added image inversion for DVB subtitles (light text on dark background)
to improve Tesseract OCR accuracy
- Added contrast normalization to further improve character recognition
- Fixed nofontcolor check to respect --no-fontcolor parameter
- Added iteration safety limit in color detection loop
4. **--ocrlang parameter fix** (Rust files):
- Changed ocrlang from Language enum to String to accept Tesseract language
names directly (e.g., "chi_tra", "chi_sim", "eng")
- Added case-insensitive matching for --dvblang parameter
- Added better error messages for invalid language codes
Tested with 12GB Chinese DVB broadcast file:
- Timing: All timestamps now positive (0.235s, 2.594s, etc.)
- OCR: ~80-90% accuracy with chi_tra traineddata (improved from ~70%)
- No crashes during full file processing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(ocr): Fix crashes in DVB subtitle color detection
Two issues fixed in the OCR color detection code:
1. Tesseract crash during iteration:
- The color detection pass used raw color images without preprocessing
- Tesseract expects dark text on light background, but DVB subtitles
have light text on dark background
- Added grayscale conversion, inversion, and contrast enhancement
(same preprocessing as the main OCR pass)
2. Heap corruption in histogram calculation:
- The histogram loop had no bounds checking on array accesses
- Tesseract could return invalid bounding boxes causing buffer overflows
- Added validation of bounding box coordinates before processing
- Added safe index checking for copy->data and histogram arrays
Also added skip_color_detection label for clean error handling and
proper cleanup of the preprocessed image.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(dvb): Fix zero-duration subtitles and overlaps during PTS jumps
Add start_pts field to cc_subtitle struct to track raw PTS values
independent of FTS timeline resets. Modify end_time calculation in
dvbsub_handle_display_segment() to cap duration at 4 seconds when
PTS jumps cause timeline discontinuities, preventing zero-duration
and overlapping subtitles.
Also update .gitignore to exclude plans/ directory and temp files.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* feat: unpack gpac
* fix: linux ci
* fix: mac build
* fix: remove unused [no ci]
* fix: ignore config.h [no ci]
* temp commit, will drop this soon
* fix: install gpac
* fix: gpac
* fix: formatting
* fix: preproccessor directive
* fix: comment display version for now
* fix: display dlls code
* fix: bundle vcruntime in hardsubx windows
* fix: again
* fix: erros in ci
* fix: ci
* fix: add vcruntime in additional dependencies
* fix: try to copy vcruntime after build
* fix: space in runtime library
* fix: remove for now [no ci]
* fix: things in vcxproj
* fix: ci for leptonica sys
* fix: docs
* fix: copy dlls on post build event
* fix: copy vcruntime after build
* feat: add arguments through clap
* fix: type of some arguments
* fix: "-" and "--" in comments
* fix: format files
* fix: add argument parsing till mkvlang
* fix: one todo item
* chore: lint fixes
* fix: nocodec value
* fix: for nocodec
* fix: add cfg feature for hardsubx
* feat: complete till startcreditstext
* fix: add more notes, args: option affect processed
* feat: port all till network stuff
* fix: complete almost all argument parsing
* fix: error free code
* fix: complete params port
* fix: hardsubx erros
* feat: clean up main function
* fix: pr reviews
* fix: make input,output function better
* fix: variant not used warning
* fix: warnings
* fix: all clippy warnings
* feat: add tests
* feat: add tests
* chore: lint fixes
* fix: move unit tests to correct folder
* fix: remove unncessary files
* fix: make function for parse_args
* fix: review changes
* fix: Impl CcxOptions whenever I could
* fix: try to convert rust to c
* chore: push c code
* fix: add more rust to c conversions
* fix: use set methods for bitfield
* fix: errors
* fix: arguments parsing
* fix: all issues
* fix: many errors
* chore: lint fix
* fix: err
* fix: unsafe function error
* fix: unsafe warning
* fix: safety lint
* chore: add docs
* fix: windows build
* fix: function
* fix: dependencies
* fix: set_binary_mode
* chore: lint fix
* fix: set_binary_mode for windows
* fix: error
* fix: undefined reference error
* chore: remove comment
* fix: output field
* chore: fix lint
* fix: ru1, ru2, ru3
* fix: undef before
* fix: parameter and update deps
* chore: update vcpkg
* feat: add release-with-debug profile
* fix; uncomment code
* fix: update visual studio to 2022
* chore: update docs
* fix: use default vcpkg
* fix: caching logic on release ci
* fix: vcpkg caching
* fix: add setup vcpkg
* chore: remove unneccesary formatting
* fix: Always write 2 bytes for UTF-16BE
* fix: formatting
* feat: add rest of the notes to bring continuity
* fix: remove extra line
* fix: add hardsubx note
* fix: source code format error
* chore: lint fixes acc to rustfmt
* feat: add unit test ci
* fix: conversion of strings, add file queue handling
* fix: decoder cfg
* fix: update dependencies
* chore: lint fix
* chore: add safety doc
* fix: default value for CcxOptions
* fix(rust): default value for teletext
* fix: leptonica version for windows
* fix: format errors
* fix: workflow
* Revert "fix: leptonica version for windows"
This reverts commit 461ef55e7b.
* fix: pin ffmpeg to 6 for mac
* fix(parser): default values and unwrap's
* fix(parser): hardsubx fixes
* chore(parse): lint fixes
* fix(windows): switch back to sdk 2019
* fix(workflow): windows workflow revert
* fix(windows): revert to old files which were working before
* fix(workflow): pin vcpkg packages
* chore(rust): downgrade leptonica
* fix(windows): move vcpkg.json to correct place
* fix(windows): improve vcxproj
* fix(windows): workflow
* fix(windows): workflow
* fix(windows): workflow clone from vcpkg everytime
* fix(workflow): error
* fix(workflow): don't skip building vcpkg
* fix: remove depth from vcpkg
* temporary commit
* fix(windows): pin gpac and use local vcpkg manifest properly
* fix(windows): install vcpkg dependencies manually
* fix(windows): update dll names
* fix(windows); dependencies copy
* fix(windows): don't continue on error for release
* fix(macos): build ffmpeg for mac workflow
* fix: move ffmpeg to current workspace
* fix: re-add profile for windows
* fix: pkg config for mac
* fix(mac): use ffmpeg@6 from brew
* fix(macos): there is no ffmpeg_prebuilt
* fix(macos): specify ffmpeg pkg config
* fix(macos): globally define pkg config
* fix(macos): add ffmpeg include and libs dir
* fix(macos): include ffmpeg headers in makefile
* fix: include ffmpeg libraries and include directories
* fix: try to manually specify ffmpeg header in rust
* fix: also include leptonica headres
* fix: leptonica name
* fix: test
* fix: string null when output_filename is empty
* fix: error
* fix: remove cflgas
* fix(mac): disable cmake ocr hardsubx
* chore: update gitignore
* fix: null if string is empty
* fix: allow --in
* chore: bump version to 1.0 in rust
* chore: add space to trigger sp
* fix: don't panic with rust
* fix: add double dashes to indicate parameters
* chore: update CHANGES.txt
* fix: test
* fix(workflow): update workflow name
* fix(rust): linux output_filename in sampleplatform
* fix(rust): parser default values
* fix(rust): exit with MalformedParameter instead of panic
* fix(decoder): revert always write 2 bytes
* chore(rust): format
* chore: update lock file
* fix(test): test lib_ccxr and rename to test
* fix(mac): remove failing cmake_ocr test
* fix: ci errors
* fix: feature related changes
* fix: trim down default features
* fix: don't check clippy for all features
* create lib_ccxr and libccxr_exports
* chore: Fix bindgen crate version
* chore: Fix rsmpeg crate version
* docs: Add PR info in Changelogs
---------
Co-authored-by: Elbert Ronnie <elbert.ronniep@gmail.com>
* feat: unpack gpac
* fix: linux ci
* fix: mac build
* fix: remove unused [no ci]
* fix: ignore config.h [no ci]
* temp commit, will drop this soon
* fix: install gpac
* fix: gpac
* fix: formatting
* fix: preproccessor directive
* fix: comment display version for now
* fix: display dlls code
* fix: bundle vcruntime in hardsubx windows
* fix: again
* fix: erros in ci
* fix: ci
* fix: add vcruntime in additional dependencies
* fix: try to copy vcruntime after build
* fix: space in runtime library
* fix: remove for now [no ci]
* fix: things in vcxproj
* fix: ci for leptonica sys
* fix: docs
* fix: copy dlls on post build event
* fix: copy vcruntime after build
* fix: bump leptonica-sys to 0.4.3 and update Cargo.lock
* fix: bump rust version to 1.57.0 and build vcpkg for window hardsubx builds
* fix: add Bcrypt dependency
* fix: switch to rust stable
* chore: bump package versions
* fix: try to remove i686 to fix error
* fix: install tesseract and lint fixes
* fix: try using ffmpeg the third
* fix: include headers
* fix: add rsmpeg
* fix: switch default triplet to static md
* fix: import errors
* fix: directory path
* fix: pre build commands
* fix: update vcxproj
* fix: linux ci
* fix: ci fixes
* chore: lint fixes
* fix: error
* fix: copy include files
* fix: ci error
* fix: link swresample lib
* fix: some errors
* fix: include directory path and include all libraries
* fix: try to add library directories
* fix: fixes in libraries
* fix: formatting ci
* fix: mflat errors
* fix: libcurl
* fix: preprocessor definitions
* fix: add libcrypto
* fix: remove lib_hash to fix conflicts (we have libcrypto already)
* fix: add avcodec and avformat dependencies on windows
* fix: add remaining deps that may fix the build
* fix: add crypt depdency
* fix: rename conflicting names
* Revert "fix: remove lib_hash to fix conflicts (we have libcrypto already)"
This reverts commit f57ff716ed.
* fix: prefix with CC_
* fix: post build actions
* fix: ocr error
* Revert "fix: ocr error"
This reverts commit 92599454b6.
* fix: xcopy error
* fix: generated file name for x64
* fix: ocr error
* fix: add item group at top to see if it works
* fix: remove unwanted headers, removed \\ from VCPKG_ROOT, remove unwanted includes in vcxproj
* fix: add libpng for non hardsubx, comment the broken ocr code again
* fix: libpng path
* feat: add lib png headers in ClCompile
* fix: png.h not found
* fix: last try for ocr fix
* fix: libpng not found
* fix: cl compile headers
* fix: libpng and ocr
* fix: libpng error
* fix: redefinition error
* fix: zlib for non hardsubx
* fix: lib names
* fix: zlib.h not found
* Added tags file and removed the previosly wrongly writtern file
* Added .vscode to visual code section
* Added the .tags in .gitignore
* Changed *.tags to *.tags*