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

Open
opened 2026-01-29 16:54:53 +00:00 by claunia · 5 comments
Owner

Originally created by @AbHash-RixE on GitHub (Sep 2, 2025).

CCExtractor version: 0.94

Necessary information

  • Is this a regression (i.e. did it work before)? NO
  • What platform did you use? Linux
  • What were the used arguments? ./ccextractor --timestamp-map --out=webvtt output_clean.ts

Description

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.

Originally created by @AbHash-RixE on GitHub (Sep 2, 2025). CCExtractor version: 0.94 # Necessary information - Is this a regression (i.e. did it work before)? NO - What platform did you use? Linux - What were the used arguments? `./ccextractor --timestamp-map --out=webvtt output_clean.ts` # Description **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.
Author
Owner

@bbgdzxng1 commented on GitHub (Sep 27, 2025):

@AbHash-RixE... Proposed sharpening of your desired behavior statement...

Desired Behavior: If --timestamp-map is specified, add a X-TIMESTAMP-MAP header in the .webvtt file even when no subtitles are present,
i.e

WEBVTT
X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000

(I'm just nitting "default", because technically all X-TIMESTAMP-MAP headers 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.

X-TIMESTAMP-MAP=LOCAL:<cue time>,MPEGTS:<MPEG-2 time>

@bbgdzxng1 commented on GitHub (Sep 27, 2025): @AbHash-RixE... Proposed sharpening of your desired behavior statement... **Desired Behavior:** _If `--timestamp-map` is specified_, add a X-TIMESTAMP-MAP header in the .webvtt file even when no subtitles are present, i.e ``` WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000 ``` (I'm just nitting "default", because technically all `X-TIMESTAMP-MAP` headers 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. > `X-TIMESTAMP-MAP=LOCAL:<cue time>,MPEGTS:<MPEG-2 time>`
Author
Owner

@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 (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.
Author
Owner

@AbHash-RixE commented on GitHub (Oct 4, 2025):

Hi @bbgdzxng1,
When I run ./ccextractor --timestamp-map --out=webvtt BBC1.ts i get (when sub is present)
X-TIMESTAMP-MAP=MPEGTS:5215387095,LOCAL:00:00:00.000
You 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?

@AbHash-RixE commented on GitHub (Oct 4, 2025): Hi @bbgdzxng1, When I run `./ccextractor --timestamp-map --out=webvtt BBC1.ts` i get (when sub is present) `X-TIMESTAMP-MAP=MPEGTS:5215387095,LOCAL:00:00:00.000` You 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?
Author
Owner

@bbgdzxng1 commented on GitHub (Oct 6, 2025):

@AbHash-RixE

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?

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.

@bbgdzxng1 commented on GitHub (Oct 6, 2025): @AbHash-RixE > 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? 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.
Author
Owner

@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!

@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!**
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#842