mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-04-27 16:40:07 +00:00
[IMPROVEMENT] Add Default X-TIMESTAMP-MAP Header When No Subtitles Are Present #842
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AbHash-RixE on GitHub (Sep 2, 2025).
CCExtractor version: 0.94
Necessary information
./ccextractor --timestamp-map --out=webvtt output_clean.tsDescription
Current Behavior: When there are no subtitles in the .ts file, the tool (CCExtractor) produces an empty .webvtt file ,
i.e no X-TIMESTAMP-MAP header is produced . This is expected behavior, as no subtitles are present.
Desired Behavior: To add a default X-TIMESTAMP-MAP header in the .webvtt file even when no subtitles are present,
i.e
X-TIMESTAMP-MAP=MPEGTS:0,LOCAL:00:00:00.000.This would ensure that the .webvtt file is consistently formatted, even when there are no subtitles present, which is necessary for HLS stream compatibility.
@bbgdzxng1 commented on GitHub (Sep 27, 2025):
@AbHash-RixE... Proposed sharpening of your desired behavior statement...
Desired Behavior: If
--timestamp-mapis specified, add a X-TIMESTAMP-MAP header in the .webvtt file even when no subtitles are present,i.e
(I'm just nitting "default", because technically all
X-TIMESTAMP-MAPheaders are invalid WebVTT, they just happen to be valid HLS, due to a long-running saga around the exact definition of WebVTT metadata headers). Background:https://github.com/w3c/webvtt/issues/485#issuecomment-639553893
https://mailarchive.ietf.org/arch/msg/hls-interest/MzTHEqH3FVE5E3chn8ULjUon9b8/
And secondly, nitting that from a format perspective, HLS RFC defines that LOCAL is the first field, MPEGTS is the second.
@AbHash-RixE commented on GitHub (Sep 30, 2025):
Hi @bbgdzxng1, thank you for the clarification and pointing out the correct field order ( LOCAL before MPEGTS ) as
per the HLS spec — | wasn't aware of that .
I'll update the desired behavior.
@AbHash-RixE commented on GitHub (Oct 4, 2025):
Hi @bbgdzxng1,
When I run
./ccextractor --timestamp-map --out=webvtt BBC1.tsi get (when sub is present)X-TIMESTAMP-MAP=MPEGTS:5215387095,LOCAL:00:00:00.000You previously mentioned the correct format (for when no subtitles are present) should be:
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000.However, the output differs in order. This has a different field order. I'm a bit confused — is ccextractor currently producing the wrong order when subtitles are present?
@bbgdzxng1 commented on GitHub (Oct 6, 2025):
@AbHash-RixE
Technically, yes. Reality is that it is just a pedantic nit. It will make no practical difference either way.
I prepped a PR which you can steal as part of your improvement for empty cues. https://github.com/bbgdzxng1/ccextractor/pull/1
The change just brings it in line with spec.
@sairajsachinpatil commented on GitHub (Jan 26, 2026):
It appears that this issue has been resolved by PR #1772 and the associated commit.
Thank you to everyone involved in the discussion and fix. If everything looks good from the maintainer’s side, this issue can likely be closed now. Much appreciated!