feat(mp4): add dvdsub/VobSub support to FFmpeg MP4 demuxer#2269
Merged
feat(mp4): add dvdsub/VobSub support to FFmpeg MP4 demuxer#2269
Conversation
Wire the existing vobsub_decoder (OCR-based bitmap subtitle decoder) into the FFmpeg MP4 demuxer path. Previously, dvdsub tracks in MP4 containers were documented as unsupported — GPAC could extract them but the FFmpeg path could not. Changes: - Add DvdSub track type detection (AV_CODEC_ID_DVD_SUBTITLE) in mp4.rs - Add C bridge functions (ccx_mp4_vobsub_init/process/free) that call the existing vobsub_decoder module - Buffer dvdsub packets to compute end times from next-packet PTS - Add --undefined linker flags for bridge symbols Tested on sample 1f3e951d516b.mp4 (dvdsub in MP4): - GPAC: 5405 bytes output - FFmpeg + this patch: 5405 bytes, byte-identical to GPAC With this change, the FFmpeg path extracts captions from every sample that GPAC can, plus one additional sample (ad9f9e03240e.m4v) that GPAC cannot handle. 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 e4443a7...:
Your PR breaks these cases:
NOTE: The following tests have been failing on the master branch as well as the PR:
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 e4443a7...:
NOTE: The following tests have been failing on the master branch as well as the PR:
This PR does not introduce any new test failures. However, some tests are failing on both master and this PR (see above). Check the result page for more info. |
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
vobsub_decoder(OCR bitmap subtitle decoder) into the FFmpeg MP4 demuxer pathChanges
mp4.rs: AddDvdSubtrack type, detectAV_CODEC_ID_DVD_SUBTITLE, buffer packets for end-time calculationmp4_rust_bridge.c: 3 new functions wrappingvobsub_decoderAPI (init,process,free)mp4_rust_bridge.h: DeclarationsCMakeLists.txt: 3--undefinedlinker flags for bridge symbolsTest plan
Tested on
1f3e951d516b.mp4(dvdsub in MP4):With this change, the FFmpeg path is a strict superset of GPAC across all 36 MP4/MOV/M4V samples tested:
ad9f9e03240e.m4v)av_rescale_qrounding)