TeamNewPipe / NewPipe

A libre lightweight streaming front-end for Android.
https://newpipe.net
GNU General Public License v3.0
30.78k stars 3.01k forks source link

Subtitles: don't update the currently visible ones #4096

Open tbertels opened 4 years ago

tbertels commented 4 years ago

Version

Steps to reproduce the bug

Watch a video with subtitles.

Expected behavior

Most video players replace both lines of text at once so that the user doesn't have to chase down the line they were reading.

Actual behaviour

The bottom line of text becomes the top line and a new line is used as the bottom line.

Screenshots/Screen recordings

20200808_105707m.zip

Stypox commented 4 years ago

I think this is how subtitles are shown by default with the player (exoplayer) being used by NewPipe. @Redirion do you happen to know if there is any switch allowing to customize how subtitles are shown? If there is not, this issue will be closed, as it can't be solved inside NewPipe

tbertels commented 4 years ago

Isn't there an upstream label?

Redirion commented 4 years ago

is this after downloading a video or when directly watching on youtube? It might either be an issue of the downloader or an issue of the video source itself. I have tried a random video on youtube with subtitles and it was showing the expected behaviour.

tbertels commented 4 years ago

It's when directly watching on youtube a video with auto (auto created by youtube) subtitles.

Redirion commented 4 years ago

can you please share the video url or name?

tbertels commented 4 years ago

It's https://www.youtube.com/watch?v=jP1nw71E9g0 Same thing with https://www.youtube.com/watch?v=dX-OGrA22oU Notice that on youtube, it's shown word by word.

Redirion commented 4 years ago

I tried to dig into it. I believe Youtube automatic captioning uses CEA-608 encoded subtitles. These can contain an information about their nature which seems to be ROLL_UP mode with 2 rows: https://github.com/google/ExoPlayer/blob/release-v2/library/core/src/main/java/com/google/android/exoplayer2/text/cea/Cea608Decoder.java#L505

it appears that this may be overwritten with setCaptioningMode however I don't even know for sure if youtube really uses CEA-608 captioning or how to access it from within NewPipe.

tbertels commented 4 years ago

Here's the json file of the first video subtitles: timedtext.zip (available here)

Here's a snapshot of the first two lines shown: snapshot

And the beginning of the subtitles json file including those two lines:

{
  "wireMagic": "pb3",
  "pens": [ {

  }, {
    "fcForeColor": 15066597
  }, {
    "fcForeColor": 13421772
  } ],
  "wsWinStyles": [ {

  }, {
    "mhModeHint": 2,
    "juJustifCode": 0,
    "sdScrollDir": 3
  } ],
  "wpWinPositions": [ {

  }, {
    "apPoint": 6,
    "ahHorPos": 20,
    "avVerPos": 100,
    "rcRows": 2,
    "ccCols": 40
  } ],
  "events": [ {
    "tStartMs": 0,
    "dDurationMs": 3309890,
    "id": 1,
    "wpWinPosId": 1,
    "wsWinStyleId": 1
  }, {
    "tStartMs": 2139,
    "dDurationMs": 6211,
    "wWinId": 1,
    "segs": [ {
      "utf8": "really",
      "acAsrConf": 252
    }, {
      "utf8": " pioneers",
      "tOffsetMs": 661,
      "acAsrConf": 234
    }, {
      "utf8": " for",
      "tOffsetMs": 1731,
      "acAsrConf": 217
    }, {
      "utf8": " all",
      "tOffsetMs": 2731,
      "acAsrConf": 217
    }, {
      "utf8": " of",
      "tOffsetMs": 2911,
      "acAsrConf": 212
    }, {
      "utf8": " us",
      "tOffsetMs": 3090,
      "acAsrConf": 252
    }, {
      "utf8": " you",
      "tOffsetMs": 3241,
      "acAsrConf": 207
    }, {
      "utf8": " know",
      "tOffsetMs": 4111,
      "acAsrConf": 219
    } ]
  }, {
    "tStartMs": 6329,
    "dDurationMs": 2021,
    "wWinId": 1,
    "aAppend": 1,
    "segs": [ {
      "utf8": "\n"
    } ]
  }, {
    "tStartMs": 6339,
    "dDurationMs": 4741,
    "wWinId": 1,
    "segs": [ {
      "utf8": "they",
      "acAsrConf": 233
    }, {
      "utf8": " have",
      "tOffsetMs": 181,
      "acAsrConf": 234
    }, {
      "utf8": " gone",
      "tOffsetMs": 270,
      "acAsrConf": 240
    }, {
      "utf8": " before",
      "tOffsetMs": 480,
      "acAsrConf": 252
    }, {
      "utf8": " us",
      "tOffsetMs": 721,
      "acAsrConf": 252
    }, {
      "utf8": " they",
      "tOffsetMs": 931,
      "acAsrConf": 226
    }, {
      "utf8": " have",
      "tOffsetMs": 1290,
      "acAsrConf": 252
    }, {
      "utf8": " cut",
      "tOffsetMs": 1531,
      "acAsrConf": 252
    } ]
  }
opusforlife2 commented 3 years ago

I don't even know for sure if youtube really uses CEA-608 captioning or how to access it from within NewPipe.

@Redirion See #3111 and #4216.