fix(build): decouple WITH_FFMPEG from ENABLE_HARDSUBX, fix FFmpeg 5.0+ API#2259
Merged
fix(build): decouple WITH_FFMPEG from ENABLE_HARDSUBX, fix FFmpeg 5.0+ API#2259
Conversation
…+ API Since 2017 (commit 4f5f564), WITH_FFMPEG=ON automatically defined ENABLE_HARDSUBX. In 2018 (PR #966), WITH_HARDSUBX was added as a separate option but the old coupling was never removed. This made -DWITH_FFMPEG=ON fail to build because it compiled hardsubx code without linking tesseract/leptonica. Fixes: - Remove ENABLE_HARDSUBX from both WITH_FFMPEG blocks (src/CMakeLists.txt and src/lib_ccx/CMakeLists.txt). ENABLE_HARDSUBX is now only defined by the WITH_HARDSUBX block, where it belongs. - WITH_HARDSUBX now auto-enables WITH_OCR and WITH_FFMPEG since it requires both. Previously -DWITH_HARDSUBX=ON without -DWITH_OCR=ON also failed to link. - Fix const AVCodec* in ffmpeg_intgr.c for FFmpeg 5.0+ API (the av_find_best_stream signature changed in libavcodec 59). Tested all 7 build combinations: 1. Default OK (was OK) 2. WITH_FFMPEG OK (was BROKEN) 3. WITH_HARDSUBX + WITH_OCR OK (was OK) 4. WITH_FFMPEG + WITH_HARDSUBX + OCR OK (was BROKEN) 5. WITH_FFMPEG + WITH_OCR OK (was BROKEN) 6. WITH_OCR OK (was OK) 7. WITH_HARDSUBX only OK (was BROKEN) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Collaborator
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 5fdd9b8...:
Your PR breaks these cases:
NOTE: The following tests have been failing on the master branch as well as the PR:
Congratulations: Merging this PR would fix the following tests:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
Collaborator
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 395f9b3...:
Your PR breaks these cases:
NOTE: The following tests have been failing on the master branch as well as the PR:
Congratulations: Merging this PR would fix the following tests:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
This was referenced Apr 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ENABLE_HARDSUBXfromWITH_FFMPEGCMake blocks — hardsubx should only be enabled byWITH_HARDSUBX, not implied by FFmpegWITH_HARDSUBXnow auto-enablesWITH_OCRandWITH_FFMPEG(it requires both)const AVCodec*inffmpeg_intgr.cfor FFmpeg 5.0+ API compatibilityBackground
Since 2017 (commit
4f5f564b),WITH_FFMPEG=ONautomatically definedENABLE_HARDSUBX. At that time there was no separateWITH_HARDSUBXoption — FFmpeg and hardsubx were the same thing. In 2018 (PR #966),WITH_HARDSUBXwas added as a separate option but the old coupling was never removed. This made-DWITH_FFMPEG=ONfail because it compiled hardsubx code without linking tesseract/leptonica.Test plan
All 7 build combinations tested:
WITH_FFMPEGWITH_HARDSUBX+WITH_OCRWITH_FFMPEG+WITH_HARDSUBX+WITH_OCRWITH_FFMPEG+WITH_OCRWITH_OCRWITH_HARDSUBXonlyDefault build regression test: output byte-identical to master.
🤖 Generated with Claude Code