-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Add sub-text-all property #12810
Comments
Not possible for many files to get all subtitle lines without parsing through the entire file, as the data can be scattered across the file near each video/audio data chunk. You'll notice that ffmpeg can extract some subtitles near instantly and others will take a while. |
This is completely out of scope for mpv, you're looking to use something like Aegisub for |
when try to add bilingual subtitle track on the fly with embedded subtitle, currently have to use ffmpeg to get the entire subtitle, it seems unoptimized when mpv is already loading the file |
mpv has the file loaded, but it won't read the entire thing at once of course. It only reads what is necessary for playback. For mpv to do what you want, it would have to read the entire file from beginning to end again which is no different from just using ffmpeg to read the whole thing. |
copy that |
What if the property only returns the subtitle lines that mpv already knows about? |
mpv only holds onto a couple of subtitle packets at a time. Anything older gets discarded, so I don't think there's any way for this other than reading through all the packets again which I'm not sure we want to do. |
Well we could just not discard them 🙃 I don't think the memory overhead for some text would be a problem. |
Where? Afaict all events are buffered unless the ASS_Track is flushed which only happens when we reset the sub track. |
I thought libass internally discarded stuff after a while. But sure I could be wrong. Feel free to send a patch if it's not so bad. |
this commit added a sub-text-all, secondary-sub-text-all property I'm not a experience c coder, so the code may need some clean up to conform to mpv's code standard, but it works on my local bilingual player (not production tested though, because I'm the only user who use it) |
Currently there has property sub-text https://mpv.io/manual/master/#command-interface-sub-text to observe the text of the current sub. It would be nice to have a similar property for the entire subtitle, possibly called sub-text-all
the usage of this feature may be to get the entire embedded subtitle and then translate it and add a translated subtitle track on the fly
Expected behavior of the wanted feature
add a sub-text-all property to return the current entire subtitle as text
The text was updated successfully, but these errors were encountered: