Skip to content

Conversation

@dRaniwal
Copy link

Problem

I noticed that when running CCExtractor with the --timestamp-map flag on a video file that has no subtitles, the resulting WebVTT file was just empty with only "WEBVTT" at the top. The X-TIMESTAMP-MAP header was completely missing, which breaks HLS streaming compatibility.

What I changed

  • Updated write_webvtt_header() so it can write to a specific output file
  • Added a fallback that writes a default timestamp map (X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000) when there's no timing info available
  • Made sure WebVTT files get their header written even when there are no subtitles by handling this in write_subtitle_file_footer()
  • Fixed a cleanup issue where encoders weren't being properly closed if no subtitles were found

Fixes #1743

In raising this pull request, I confirm the following (please check boxes):

  • I have read and understood the contributors guide.
  • I have checked that another pull request for this purpose does not exist.
  • I have considered, and confirmed that this submission will be valuable to others.
  • I accept that this submission may not be used, and the pull request closed at the will of the maintainer.
  • I give this submission freely, and claim no ownership to its content.
  • I have mentioned this change in the changelog.

My familiarity with the project is as follows (check one):

  • I have never used CCExtractor.
  • I have used CCExtractor just a couple of times.
  • I absolutely love CCExtractor, but have not contributed previously.
  • I am an active contributor to CCExtractor.

Testing

Ran CCExtractor on a .ts file with no subtitles using the --timestamp-map flag. Before this fix, the output was just "WEBVTT". Now it correctly outputs:

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-bot
Copy link
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 42d7509...:
Report Name Tests Passed
Broken 13/13
CEA-708 14/14
DVB 7/7
DVD 3/3
DVR-MS 2/2
General 27/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 86/86
Teletext 21/21
WTV 13/13
XDS 34/34

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.

@dRaniwal
Copy link
Author

Hi! The Windows CI failure is unrelated to my changes - it's failing due to a vcpkg download issue with libxml2 from GitLab:
Download failed, halting portfile. error: building libxml2:x64-windows-static failed with: BUILD_FAILED

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!

@cfsmp3
Copy link
Contributor

cfsmp3 commented Nov 27, 2025

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.

@steel-bucket
Copy link
Contributor

The Windows CI malfunction is currently being fixed. The vcpkg problem has been fixed(credit to @DhanushVarma-2), but the Rust Build isn't working for the latest changes as there were some uncaught errors that were merged. We're working on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[IMPROVEMENT] Add Default X-TIMESTAMP-MAP Header When No Subtitles Are Present

4 participants