Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accented characters being displayed twice in 607/608 stream #6427

Closed
5 tasks done
mamaddox opened this issue May 21, 2024 · 0 comments · Fixed by #6439, anime-vsub/app#107 or anime-vsub/app#108
Closed
5 tasks done

Comments

@mamaddox
Copy link

What version of Hls.js are you using?

1.4.10 (But tested on 1.5.8 as well)

What browser (including version) are you using?

Chrome 124.0.6367.62

What OS (including version) are you using?

macOS 12.7.2

Test stream

https://cpac-vod.cdn.vustreams.com/cpac/vod/b69d4bce-1c39-4fb4-9b1e-ad016553bb8b/b69d4bce-1c39-4fb4-9b1e-ad016553bb8b_nodrm_3a7ee1c0-beb8-41eb-8623-d00096e3de23.ism/.m3u8

Configuration

{
  "debug": true,
  "enableWorker": true,
  "lowLatencyMode": true,
  "backBufferLength": 90
}

Additional player setup steps

No response

Checklist

Steps to reproduce

  1. Load the test stream
  2. Turn on captions when they become available
  3. See that some accented characters are being duplicated

Expected behaviour

Accented characters should be displayed only once

What actually happened?

Certain accented characters are displaying twice
Screen Shot 2024-05-21 at 10 59 22 AM

Did a little investigation in the cea-608-parser.ts, and it looks like characters 0x80-0x8f are the special characters that are being duplicated:

0x80: 0xae, // Registered symbol (R)
0x81: 0xb0, // degree sign
0x82: 0xbd, // 1/2 symbol
0x83: 0xbf, // Inverted (open) question mark
0x84: 0x2122, // Trademark symbol (TM)
0x85: 0xa2, // Cents symbol
0x86: 0xa3, // Pounds sterling
0x87: 0x266a, // Music 8'th note
0x88: 0xe0, // lowercase a, grave accent
0x89: 0x20, // transparent space (regular)
0x8a: 0xe8, // lowercase e, grave accent
0x8b: 0xe2, // lowercase a, circumflex accent
0x8c: 0xea, // lowercase e, circumflex accent
0x8d: 0xee, // lowercase i, circumflex accent
0x8e: 0xf4, // lowercase o, circumflex accent
0x8f: 0xfb, // lowercase u, circumflex accent

Not sure if it's related to the insertChar function.

insertChar(byte: number) {
if (byte >= 0x90) {
// Extended char
this.backSpace();
}
const char = getCharForByte(byte);
if (this.pos >= NR_COLS) {
this.logger.log(
VerboseLevel.ERROR,
() =>
'Cannot insert ' +
byte.toString(16) +
' (' +
char +
') at position ' +
this.pos +
'. Skipping it!',
);
return;
}
this.chars[this.pos].setChar(char, this.currPenState);
this.moveCursor(1);
}

Console output

[log] > [stream-controller]: media seeking to 226.834, state: ENDED
base-stream-controller.ts:1639 [log] > [stream-controller]: Reset loading state
base-stream-controller.ts:1781 [log] > [stream-controller]: ENDED->IDLE
base-stream-controller.ts:241 [log] > [audio-stream-controller]: media seeking to 226.834, state: ENDED
base-stream-controller.ts:1639 [log] > [audio-stream-controller]: Reset loading state
base-stream-controller.ts:1781 [log] > [audio-stream-controller]: ENDED->IDLE
base-stream-controller.ts:241 [log] > [subtitle-stream-controller]: media seeking to 226.834, state: IDLE
buffer-controller.ts:645 [log] > [buffer-controller] Queueing mediaSource.endOfStream()
base-stream-controller.ts:1781 [log] > [stream-controller]: IDLE->ENDED
buffer-controller.ts:656 [log] > [buffer-controller] Could not call mediaSource.endOfStream(). mediaSource.readyState: ended
buffer-controller.ts:645 [log] > [buffer-controller] Queueing mediaSource.endOfStream()
base-stream-controller.ts:1781 [log] > [audio-stream-controller]: IDLE->ENDED
buffer-controller.ts:656 [log] > [buffer-controller] Could not call mediaSource.endOfStream(). mediaSource.readyState: ended
stream-controller.ts:556 [log] > [stream-controller]: Media seeked to 226.834

Chrome media internals output

No response

@mamaddox mamaddox added Bug Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels May 21, 2024
@robwalch robwalch added Confirmed and removed Needs Triage If there is a suspected stream issue, apply this label to triage if it is something we should fix. labels May 21, 2024
@robwalch robwalch added this to the 1.5.9 milestone May 21, 2024
robwalch added a commit that referenced this issue May 24, 2024
robwalch added a commit that referenced this issue May 24, 2024
…er seek (#6439)

* Fix 608 parser handling of redundant control codes
Fixes #6427

* Fix 608 caption TextTrack Cue seek/discontinuity timing regression introduced in v1.5.0 with #5557
robwalch added a commit that referenced this issue May 31, 2024
* patch/v1.5.x:
  Update github actions
  chore(deps): update tjenkinson/gh-action-auto-merge-dependency-updates action to v1.4.2 (#6333)
  Emit FRAG_PARSING_ERROR on unsupported M2TS codec (#6447)
  Fix JS AES fallback when browserCrypto.subtle returns undefined (rather than null) (#6446)
  Fix 608 caption TextTrack Cue seek/discontinuity timing regression introduced in v1.5.0 with #5557
  Fix 608 parser handling of redundant control codes Fixes #6427
  Fix backtracking when an appended segment has no buffered timerange (#6434)
  Fix missing details if subtitle changed synchronously after loaded and before onLoaded callback (#6424)
  Bugfix: Handle irregular white-space in segment URIs (#6396)
agajassi added a commit to streaming-video-technology-alliance/common-media-library that referenced this issue Jun 5, 2024
agajassi added a commit to streaming-video-technology-alliance/common-media-library that referenced this issue Jun 5, 2024
agajassi added a commit to streaming-video-technology-alliance/common-media-library that referenced this issue Jun 5, 2024
ported changes from video-dev/hls.js#6427

Signed-off-by: Agajan Jumakuliyev <agajan.tm@gmail.com>
agajassi added a commit to streaming-video-technology-alliance/common-media-library that referenced this issue Jun 5, 2024
ported changes from video-dev/hls.js#6427

Signed-off-by: Agajan Jumakuliyev <agajan.tm@gmail.com>
littlespex pushed a commit to streaming-video-technology-alliance/common-media-library that referenced this issue Jun 5, 2024
* Create extractCea608DataFromSample.ts
* Create seiHelpers.ts
* Update extractCea608DataFromSample.ts
* Update seiHelpers.ts
* Update getCharForByte.ts
* ported changes from video-dev/hls.js#6427
* Create SccParser.ts
* Update Cta608Parser.ts

---------

Signed-off-by: Agajan Jumakuliyev <agajan.tm@gmail.com>
littlespex pushed a commit to streaming-video-technology-alliance/common-media-library that referenced this issue Jun 5, 2024
* Create extractCea608DataFromSample.ts
* Create seiHelpers.ts
* Update extractCea608DataFromSample.ts
* Update seiHelpers.ts
* Update getCharForByte.ts
* ported changes from video-dev/hls.js#6427
* Create SccParser.ts
* Update Cta608Parser.ts

---------

Signed-off-by: Agajan Jumakuliyev <agajan.tm@gmail.com>
Signed-off-by: Casey Occhialini <1508707+littlespex@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment