mpv-translate: Add translation to mpv via js scripts #14976
ahaoboy
started this conversation in
Show and tell
Replies: 2 comments 4 replies
-
What is missing in mpv and what does "mpv-easy" add? If a script only works on a fork of mpv then I'm not sure the mpv discussions page is the right place to advertise it. |
Beta Was this translation helpful? Give feedback.
1 reply
-
You can just call |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
mpv-translate: A Translation Plugin for mpv-easy
mpv-translate is a translation plugin for mpv-easy. Due to its reliance on APIs not supported by the mpv JS script, it can only be used within mpv-easy. To get started, download the mpy-easy-windows-full.zip, which has only been tested on the Windows platform. You can activate the plugin using the shortcut key
Ctrl + T
.How It Works
Export Subtitles: Uses FFmpeg to extract subtitles from the current video and convert them into SRT format.
Translation: Employs the Google Translate API to translate the SRT files into your desired language.
Integration: Adds the translated subtitles back into your video.
Please note that the translation process can be slow, taking 5 to 10 seconds depending on network conditions. However, results are cached after the initial translation to improve efficiency.
Future Improvements
Currently, mpv cannot directly obtain all subtitles, necessitating the use of FFmpeg, which increases the program size and does not support remote video. How to extract subtitles to a file by using mpv
Real-time translation experiences may suffer from network delays, and there is a risk of IP blocking.
The mpv JS script's lack of network API support means it cannot function as a standalone script.
interactive-translate
Similar to interSubs, hovering over a word displays the word's info card, left mouse clicking on the word plays the word's audio, wheel clicking displays the line's translation.
You can use
ctrl+i
to start interactive translation, which is still in its early stages, so for now, you can only use it in the mpv-easy project.Currently only support English to Chinese, still need other language dictionary and translation api
github: https://github.com/mpv-easy/mpv-easy
Beta Was this translation helpful? Give feedback.
All reactions