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

Improve parsing speed for large WebVTT files #4948

Open
xinyang123123 opened this issue Oct 13, 2018 · 4 comments
Open

Improve parsing speed for large WebVTT files #4948

xinyang123123 opened this issue Oct 13, 2018 · 4 comments

Comments

@xinyang123123
Copy link

After selecting the specified subtitle, it will appear 5-10 seconds later, but the audio is still synchronized after the appearance. I use TrackSelectionView to switch the subtitle. The version number is 2.8.4.

I am testing on Fire TV.

@xinyang123123
Copy link
Author

When my vtt subtitle file is about 4M, it takes 30 seconds to load.

@ojw28 ojw28 self-assigned this Oct 15, 2018
@ojw28
Copy link
Contributor

ojw28 commented Oct 15, 2018

Please provide complete information as requested in the issue template. The issue template can be found here.

@xinyang123123
Copy link
Author

Issue description

When i try to load a subtitles which size over than 4M, the subtitles will show untill fully loaded. before loading successfully, there will no any signal shows subtitles is loading.
I tried in FireTV stick and FireTV ,there are 15-40 seconds loading time, and the subtitles shows correctly when loaded successfully.

Reproduction steps

Open the video and select subtitle.

Link to test content

Email.

Version of ExoPlayer being used

2.8.4

Device(s) and version(s) of Android being used

Fire Tv(7.1.2)
Fire Tv stick(5.1)

A full bug report captured from the device

No error.

@xinyang123123 xinyang123123 changed the title 5-10 seconds delay when switching subtitles 5-40 seconds delay when switching subtitles Oct 16, 2018
@ojw28
Copy link
Contributor

ojw28 commented Nov 23, 2018

It takes about 3.5 seconds on a Galaxy S8. It looks like this is just how long it takes for our current implementation to parse the VTT file, which is pretty huge (over 127 thousand lines). If it needs to be downloaded as well, that will add additional delay.

I don't think we have any plans to process such files incrementally. It is probably possible to make the parsing code in WebvttCueParser significantly faster, since it looks like it's not particularly optimized currently. In particular, the use of Pattern is likely to be expensive, and there are a lot of new String instances being created during parsing.

Marking as a low priority enhancement. We would accept a high quality pull request that improves the speed of the parsing code.

@ojw28 ojw28 changed the title 5-40 seconds delay when switching subtitles Improve parsing speed for large WebVTT files Nov 23, 2018
@icbaker icbaker assigned icbaker and unassigned ojw28 Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants