popcorn-official / popcorn-desktop

Popcorn Time is a multi-platform, free software BitTorrent client that includes an integrated media player ( Windows / Mac / Linux ) A Butter-Project Fork
https://popcorn-time.site
Other
9.46k stars 625 forks source link

"Error reading subtitle timings, file seems to be corrupted" #1013

Closed juanstoledoc closed 3 years ago

juanstoledoc commented 5 years ago

Operating System Version: OS X 10.12.6

Popcorn Time Version: Version 0.3.10

Download date: May 9, 2019

Expected Behaviour

I simply wanted to load some subtitles from the in-app droplist.

Actual Behaviour

The app freezes for a moment, and then displays a message in a red box that reads:

"Error reading subtitle timings, file seems to be corrupted Try another subtitle or simply drop one in the player"

It happens with all subtitles in any language.

Steps to reproduce the behaviour

  1. Simply start playing any given show or movie.
  2. Once it starts playing, try picking any language from the add subtitles option.
  3. The screen will freeze for a moment, and the error will appear afterwards. The show or movie will also continue playing, but without any subtitles. The keyboard shortcuts for stuff like faster or slower playing or changing the timing for subtitles will also stop working.

error

juanstoledoc commented 5 years ago

I've recently tried the app in a Windows computer, and it had the same problem.

dutchy1001 commented 4 years ago

It might be that opensubtitles were feeding you bad subtitles due to your IP. They were known to do that

It would be informative to know what country and/or ISP might be causing this, this way in the future we can answer why this happens.

Also using an (very) old version is not helping the issue.

Persei08 commented 4 years ago

hmm, i think bad subtitles timing is another thing not related to opensuibtitles blocking some ip ranges.

I don't think bad subtitles timing is caused by a PT issue, but if it brake shortcuts then, there is probably the shortcuts to fix.

No ?

dutchy1001 commented 4 years ago

I don't think bad subtitles timing is caused by a PT issue

Agreed there, as I said in an other post (#1714 ) timings for subs are depending on what source they have been made with, then you have the frame rate that can also be different.

About the keyboard shortcuts.. he was using 0.3.10.. so who knows if the issue still exists/ever existed.

Update to latest build first and see if the OP still has that issue with the shortcuts would be the first thing to do

dutchy1001 commented 4 years ago

I just realised, this issue is from May 2019, the OP might have moved on or got already a new version without the issue. Unless the OP reports back I would not spend more time here (I saw the version 3.1.0 but didn't look at the date made).

dutchy1001 commented 4 years ago

Harry Potter and the Philosopher's Stone with Greek subs gives me also the error for subtitle, but then it still shows it. Spacebar doesn't work but P does also I can use G and H for timings

greek potter

When using my external (SMPlayer) player I dont get the error and subs just play normal too.

Console output gives: videojshooks.js:334 Error reading subtitles timing, file seems corrupted TypeError: Cannot read property 'split' of undefined at subObj.vjs.TextTrack.parseCueTime (chrome-extension://hecfofbbdfadifpemejbbdcjmfmboohj/node_modules/video.js/dist/video-js/video.dev.js:8291:17) at subObj.vjs.TextTrack.parseCues (chrome-extension://hecfofbbdfadifpemejbbdcjmfmboohj/node_modules/video.js/dist/video-js/video.dev.js:8248:28) at vjsBind (chrome-extension://hecfofbbdfadifpemejbbdcjmfmboohj/src/app/vendor/videojshooks.js:332:23) at parse (chrome-extension://hecfofbbdfadifpemejbbdcjmfmboohj/src/app/vendor/videojshooks.js:297:17) at decode (chrome-extension://hecfofbbdfadifpemejbbdcjmfmboohj/src/app/vendor/videojshooks.js:326:17) at chrome-extension://hecfofbbdfadifpemejbbdcjmfmboohj/src/app/vendor/videojshooks.js:362:17 at Request._callback (chrome-extension://hecfofbbdfadifpemejbbdcjmfmboohj/src/app/vendor/videojshooks.js:132:25) at Request.self.callback (C:\Users\Mike\AppData\Local\Popcorn-Time\node_modules\request\request.js:185:22) at Request.emit (events.js:316:20) at Request.<anonymous> (C:\Users\Mike\AppData\Local\Popcorn-Time\node_modules\request\request.js:1161:10)

dutchy1001 commented 4 years ago

App.vent.trigger('notification:show', new App.Model.Notification({title: i18n.__('Random notification'),autoclose: true})); Does indeed break the space for me too

Persei08 commented 3 years ago

Ok, reopening this one, because I encounter the issue and have more details to provide.


Step to reproduce:


-PCT will download the subtitles srt file from opensubtitles api... (http://dl.opensubtitles.org/en/download/src-api/vrf-19d80c5d/sid-weGQcc7naP4MHQ1HbPa9xuBsua9/filead/1956393619) The subtitle file is edited by opensubtitles to add advertisement for opensubtitles.org.

-You can go on opensubtitles.org and download the zip archive of the subtitles here: https://www.opensubtitles.org/en/subtitles/7822010/shazam-fr The subtitles isn't edited and doesn't contain advertisement.

Download both subtitles and try each of them.

Now if you compare the 2 whole srt file, you will notice (https://www.diffchecker.com/w9DACkiC) :

The one from opensubtitles api:

1
00:00:06,000 --> 00:00:12,074
Annoncez votre produit ou votre marque ici. 
Contactez www.OpenSubtitles.org aujourd'hui !

2
00:00:45,754 --> 00:00:50,259
ÉTAT DE NEW YORK

3
2
00:00:59,142 --> 00:01:01,144
N'Y COMPTE PAS

4
00:01:02,896 --> 00:01:04,022
Thad !

(...)

1575
02:11:35,020 --> 02:11:36,063
Sous-titres : Pierre Arson

1577
02:11:37,305 --> 02:12:37,469
Soutenez-nous et devenez membre VIP pour désactiver toutes les publicités sur www.OpenSubtitles.org

The one from opensubtitles site:

1
00:00:45,754 --> 00:00:50,259
ÉTAT DE NEW YORK
1974

2
00:00:59,142 --> 00:01:01,144
N'Y COMPTE PAS

3
00:01:02,896 --> 00:01:04,022
Thad !

(...)

1574
02:11:35,020 --> 02:11:36,063
Sous-titres : Pierre Arson

So, they're messing with the subtitles index numbers.

Now if you just edit the subtitle file downloaded from the api to:

3
00:00:59,142 --> 00:01:01,144
N'Y COMPTE PAS

It works as expected, just that.

So @everyone, please report with which movies and subtitles language you got the issue, so we can do more tests and eventually find a way to correct the subtitles. Thx

dutchy1001 commented 3 years ago

To me this looks then that the opensubtitles API is causing this issue, not PCT.

BUT, when checking the Shazam with the "API" French subs is working fine for me while using an external player (SMPlayer) but not when using the default PCT player. So why does SMPlayer read through the error and PCT doesn't? Is there any way you can see from SMPlayer (source (or any other external player that works)) how it reads the subs and implement this then to PCT so it does the same to avoid the error? (me just thinking out loud here)

Persei08 commented 3 years ago

PCT use videojs web player the implementation is different.

The srt file syntax isn't right and it's what bug the thing. My guess is VLC, SMPlayer, ... better handle errors and ignore the corrupted lines.

More specificaly, PCT call the videojs parseCues fonction to read the subtitles timing, but it fail because the 3rd subtitles (line 3) should be followed with timing:

3
2
00:00:59,142 --> 00:01:01,144
N'Y COMPTE PAS

What I need here are few other exemples, to see what need to be cleaned in the subtitles.

dutchy1001 commented 3 years ago

Doesn't those external players (VLC, SMPlayer) not have an API to implement and swap the videojs web player out? Not sure this is an option...

EDIT: Trying to find a movie with corrupted subs is like finding a needle in a haystack. I've gone through about 20 movies using different language subs but no errors.

Persei08 commented 3 years ago

Doesn't those external players (VLC, SMPlayer) not have an API to implement and swap the videojs web player out? Not sure this is an option...

There was a VLC browsers plugin, but I'm not sure if it's still well supported or is not restricted by chromium... but i don't want to go this way, i'm looking for something more easy.

for my issue with shazam, I can parse the subtitle file with a regex in PCT to fix the annoying lines. then it works. but this apply to this subtitle file, there are other reasons which trigger 'subtitle timing' errors.

I was trying Games of thrones S01E03 720p with french subs... but the video file is corrupted, so it's crash the player and i don't even want to waste time trying to find the issue of the subtitles of a video which crash the player. One issue at the time is enough :D

Persei08 commented 3 years ago

Videojs really doesnt like them for some reason.

They switched the number of audio channels.

Persei08 commented 3 years ago

i close this one, will eventually repon depending the comments and details provided. Else feel free to report same issue next time you encounter it... with all details so we can try to debug and find what is wrong with the subtitles. Thx