[FIX] Fix missing X-TIMESTAMP-MAP header in WebVTT when no subtitles found#1772
[FIX] Fix missing X-TIMESTAMP-MAP header in WebVTT when no subtitles found#1772dRaniwal wants to merge 1 commit intoCCExtractor:masterfrom
Conversation
When using --timestamp-map with input files containing no subtitles, the WebVTT output file was missing the X-TIMESTAMP-MAP header. This caused HLS streaming to fail. Changes: - Modified write_webvtt_header() to accept output handle parameter - Added fallback to write default X-TIMESTAMP-MAP when timing unavailable - Added CCX_OF_WEBVTT case in write_subtitle_file_footer() - Added encoder cleanup loop in dinit_libraries() for orphaned encoders Fixes CCExtractor#1743
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 42d7509...:
Congratulations: Merging this PR would fix the following tests:
All tests passing on the master branch were passed completely. Check the result page for more info. |
|
Hi! The Windows CI failure is unrelated to my changes - it's failing due to a vcpkg download issue with I've noticed other PRs are hitting the same issue. This seems to be a transient network/infrastructure problem with the external dependency mirror. Would it be possible to re-run the CI, or could this be merged if the Linux/macOS builds pass? Happy to make any actual code changes if needed! |
I've restarted the tests. |
|
The Windows CI malfunction is currently being fixed. The |
cfsmp3
left a comment
There was a problem hiding this comment.
Excellent work! I've done a deep review and this is a high-quality fix.
Results
- ✅ ALL CI tests pass on Linux (237/237)
- ✅ Would FIX 1 test that has never passed before (hardsubx sample 184)
- ✅ Clean approach - extends existing
write_webvtt_header()function - ✅ No memory leaks
- ✅ No unrelated code bundled
- ✅ Proper orphaned encoder cleanup added
Before Merge
Please:
- Rebase on master - PR has merge conflicts
- Add changelog entry to
docs/CHANGES.TXT:- Fix: Missing X-TIMESTAMP-MAP header in WebVTT when no subtitles found (#1743)
Windows Build Failure
The Windows build failure is due to vcpkg/libxml2 infrastructure issues, not your code. This is a known issue affecting multiple PRs.
Once rebased and changelog added, this is ready to merge!
Note: PR #1744 also attempts to fix #1743, but your implementation is cleaner (no memory leaks, no unrelated ENABLE_SHARING code). We will close #1744 in favor of this PR once this is merged.
|
Hi @dRaniwal, this PR needs:
Are you still working on this? |
|
Closed due to inactivity, feel free to submit a new one (make sure it's based off master) when you are ready to resume work. |
Problem
I noticed that when running CCExtractor with the
--timestamp-mapflag on a video file that has no subtitles, the resulting WebVTT file was just empty with only "WEBVTT" at the top. TheX-TIMESTAMP-MAPheader was completely missing, which breaks HLS streaming compatibility.What I changed
write_webvtt_header()so it can write to a specific output fileX-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000) when there's no timing info availablewrite_subtitle_file_footer()Fixes #1743
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Testing
Ran CCExtractor on a
.tsfile with no subtitles using the--timestamp-mapflag. Before this fix, the output was just "WEBVTT". Now it correctly outputs: