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

Subtitles timing is off #360

Open
svalavuo opened this issue Jun 12, 2024 · 14 comments
Open

Subtitles timing is off #360

svalavuo opened this issue Jun 12, 2024 · 14 comments

Comments

@svalavuo
Copy link

Is it just me and my setup or does the latest yle-dl (20240429) make subtitles appear earlier than they should?
Tried with Vera Stanhope (https://areena.yle.fi/1-2503613) all episodes. And same with Roy Grace (https://areena.yle.fi/1-50791118) all episodes.

  • Samuli
@aajanki
Copy link
Owner

aajanki commented Jun 13, 2024

I confirm that the subtitles seem to appear a few seconds too early. I tested on VLC and on SMPlayer. When played on Areena on the web browser, the subtitle timing seems much better.

Not currently sure what is causing this. It might be that there is some kind of subtitle timing offset that does not get applied correctly on the downloaded video file.

@svalavuo
Copy link
Author

I forgot to tell which players I used, but VLC and Jellyfin (both client application and web client) behaved the same. Quite odd, that previous showings of the same episodes worked fine.

@IlmariKu
Copy link

@svalavuo I had the exact same issue with a series. Did you download the Vera Stanhope as series? I noticed with independent files they seemed to be on time, but with series, lagging for few seconds. I'm also using Jellyfin.

@svalavuo
Copy link
Author

@IlmariKu Ah, ok. I downloaded both those series as series. I have to try to download as individual episodes. Thanks for the tip!

@svalavuo
Copy link
Author

Ok. That didn't help in my case. :-( When I downloaded those as series, subtitles were a bit early. Now that I downloaded those as individual episodes, subtitles are a bit late.

@IlmariKu
Copy link

I wonder @svalavuo, if you execute the command with --showmetadata-flag, it should give you the direct url of subs as a link to Areena CDN. If you download those subs, are they on-time with the video?

@svalavuo
Copy link
Author

There is something funny going with Areena. :-)
When I execute command yle-dl --showmetadata https://areena.yle.fi/1-67480272 (Roy Grace S04E01), there is this: "subtitles": []
And at the very beginning there is an error row: [hls @ 0xe9ac40] Can't support the subtitle(uri: ../hdntl=exp=...

@aajanki
Copy link
Owner

aajanki commented Jun 17, 2024

Not all videos have external subtitle files. It seems that especially recent Areena programs do not have external subtitles anymore.

Embedded subtitles do not show up in the --showmetadata output, only external subtitles when they are available.

It is safe to ignore the "Can't support the subtitle" warning. Ffmpeg outputs it on all Areena streams but still downloads the (embedded) subtitles.

@svalavuo
Copy link
Author

There is no fix for this?
I was thinking that this might work if I rip the subtitles from mkv and try to fix the timing of this external subtitle and leave it external (and disable the embedded track) or embed it back to mkv, That would take a huge amount of time with only one season of one series. :-(

@IlmariKu
Copy link

IlmariKu commented Jul 4, 2024

I'll test this a bit. I think the list of things to figure out are:

  1. Is subtitle-delay repeatable, consistent across different devices and downloads?
  2. Are extracted subtitles delayed by default as well?

EDIT: Answer to number 2 is yes, same delay on embedded vs. extracted with ffmpeg.

To answer number 1:

This film:
https://areena.yle.fi/1-65235605 - there was exactly -2.0 second delay. I fixed it with https://subshifter.bitsnbites.eu/

Also, one another movie had exactly same -2.0sec delay subtitles. Is there a theme here? Can you download that file @svalavuo and test if you have the same delay? Fixed the sub timing with +2.0s delay

Third example, https://areena.yle.fi/1-66395414, this film, also -2.0 second delay. Fixed by adding +2.0s to it

If we can find a pattern, maybe we can do something about it.

@svalavuo
Copy link
Author

Now, what I have tried with, they are all quite close two seconds early. So I delayed subtitles that 2 seconds with mkvtoolnix. Seems to work.

@IlmariKu
Copy link

Which hardware / OS are you running? I'm using Raspberry pi with Ubuntu. I wonder if the 2 seconds is caused by something related to yle-dl or maybe some slowness in hardware.

@svalavuo
Copy link
Author

svalavuo commented Jul 14, 2024

Apparently my answer wasn't saved earlier. :-(
I use mainly Asustor AS4604T NAS and Odroid M1. Both do the same: video saves nicely and subtitles timing is about exactly two seconds off. I use Subtitle Edit to determine the offset and then MKVToolNix to insert delay to subtitle track.
The subtitle delay appears with every player I have tried: Jellyfin, VLC and Kodi. There might be some other players as well, but all of them doesn't support included subtitles but would like to have them external.

I was wondering if there is some kind of timing information delivered with the video, because browsers play them just fine.

@IlmariKu
Copy link

Yeah, it's strange, I'm experiencing the exact same behavior of 2 second delay with subtitles.

I need to personally get this fixed, so I also don't have to open up programs to manually adjust subtitles. I'll see if I find something and let the thread know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants