[oS-es] Autotraducción de subtítulos
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hola: Estoy haciendo probatinas con unos vídeos en español. Tengo los subtítulos, y he logrado traducir uno (sólo lo he intentado con uno) con DeepL al ingles. El procedimiento es tedioso. Parto de "pelicula.esp.vtt" Primero, copio el texto plano a Writer de LibreOffice (copy-paste), y lo grabo como .docx Ese fichero se lo subo a DeepL, para que lo traduzca, y me lo devuelve para descargar en inglés. No se puede hacer directamente en la web porque es demasiado texto y no lo admite. Abro en Writer el texto en inglés, y lo copio a un editor de texto plano, guardándolo como "pelicula.eng.vtt" Y finalmente, añado los subtítulos a la película: ffmpeg -i "pelicula.mkv" -i "pelicula.esp.vtt" -i "pelicula.eng.vtt" -map 0 -map 1 -map 2 -c copy -c:s copy -metadata:s:0 language=esp -metadata:s:1 language=eng \ "pelicula.esp-eng.mkv" (el método para añadir los subtítulos lo he encontrado en <https://www.bannerbear.com/blog/how-to-add-subtitles-to-a-video-file-using-ffmpeg/#adding-soft-subtitles>) Pruebo la película en VLC, y efectivamente, los subtítulos aparecen correctamente sincronizados y traducidos, aunque se muestran como track 1 y track 2, no "esp" o "ing" (eso sería otro problema, pero menor). Bien, pero tedioso, demasiada tarea manual si quiero traducir unos cuantos. ¿Se podrá automatizar? A ver que dice google. Le pregunto: how to automatically translate subtitles in srt using deepl Me salen tutoriales en youtube. Unos usan programas de Windows, no me vale. Otro hay que subir el vídeo entero, no quiero. Un vídeo es en chino. Uno promete: "4:08 Multiple Subtitle Files Translation using DeepL & Google ..." Está usando una web que se llama syedgakbar/project/dst. Parece que es lo que quiero, hasta que en el minuto 1:26 veo que hay que pagar para que haga la traducción, cuando está usando Google Translator, yandex o DeepL (que son gratuitos) para hacer la traducción! 17 céntimos por traducción. ¿Esto es normal? :-O Y los comentarios al yutube lo alaban... :-o Me acabo de acordar que Juan Erbes puso aquí un método para traducir ficheros de texto mediante linea de comandos. zypper install yarn yarn global add deepl-translator-cli Y DeepL tiene una app para Windows. ¿Funcionaría en wine? - -- Saludos Carlos E.R. -----BEGIN PGP SIGNATURE----- iHoEARECADoWIQQZEb51mJKK1KpcU/W1MxgcbY1H1QUCZBhfPRwccm9iaW4ubGlz dGFzQHRlbGVmb25pY2EubmV0AAoJELUzGBxtjUfVT40AniirEXD3YTpB8KLhM7t9 jN2X1+HaAJ9kICxyoXo+tyDkkHcnrCmUIwG0KA== =tQyj -----END PGP SIGNATURE-----
On 2023-03-20 20:21, Juan Erbes wrote:
Enviado desde mi teléfono
De: "Carlos E. R." <>
Me acabo de acordar que Juan Erbes puso aquí un método para traducir ficheros de texto mediante linea de comandos.
zypper install yarn yarn global add deepl-translator-cli
Y DeepL tiene una app para Windows. ¿Funcionaría en wine?
Probé con wine deepl y no funciona.
Ah, vaya. Bueno, una prueba que me ahorro.
Hay una web que hace el reconocimiento de voz subiendo el video o audio sólo cuando supera el tamaño máximo de archivos permitido y te da el texto en formato vtt traducido en varios idiomas
No necesito reconocimiento de voz, tengo los subtítulos hechos en español correctamente, en formato WEBVTT. Y ffmpeg los junta correctamente al vídeo. Lo único que necesito es traducirlo (el fichero de texto) con el motor de DeepL, nada más, en script. Hay un proyecto en https://github.com/vzhomeexperiments/translateVTT, pero usa googletranslate. yarn está en <https://download.opensuse.org/repositories/devel:languages:nodejs/15.4/devel:languages:nodejs.repo>, según la búsqueda oficial. En realidad, está en <https://download.opensuse.org/repositories/devel:languages:nodejs/15.4/> Telcontar:~ # yarn global add deepl-translator-cli yarn global v1.22.19 [1/4] Resolving packages... [2/4] Fetching packages... [3/4] Linking dependencies... [4/4] Building fresh packages... success Installed "deepl-translator-cli@1.1.2" with binaries: - deepl Done in 4.68s. Telcontar:~ # Probemos. cer@Telcontar:~> cat q.txt En un lugar de La Mancha de cuyo nombre no quiero acordarme, no ha mucho que vivía... cer@Telcontar:~> trans es:en file://q.txt In place of the spot whose name I don't want to remember, not long ago I lived... cer@Telcontar:~> Ostrás, eso es una traducción horrible. La web de DeepL la hace (casi) correctamente: In a place in La Mancha whose name I don't want to remember, not long ago I lived... Oye, que no usa DeepL: cer@Telcontar:~> trans -list-engines aspell * google bing spell hunspell apertium yandex cer@Telcontar:~> El resultado no se puede usar. Original: +++·········································· WEBVTT ... 9 00:01:08.860 --> 00:01:10.770 ¿Tenéis testigos de lo que decís? 10 00:01:12.180 --> 00:01:14.580 <c.vtt_cyan>Si los muertos pudieran hablar, los tendría.</c> 11 00:01:14.900 --> 00:01:16.300 Mentís. 12 00:01:21.339 --> 00:01:22.730 Mentís. 13 00:01:25.980 --> 00:01:27.370 ¡Mentís! 14 00:01:35.139 --> 00:01:36.540 <c.vtt_cyan>Yo nunca miento.</c> 15 00:01:40.019 --> 00:01:41.410 ¡Prendedlo! ··········································++- Traducción de DeepL, con el método descrito antes: +++·········································· WEBVTT ... 9 00:01:08.860 --> 00:01:10.770 Do you have witnesses to what you say? 10 00:01:12.180 --> 00:01:14.580 <c.vtt_cyan>If the dead could speak, I would have them.</c> 11 00:01:14.900 --> 00:01:16.300 You lie. 12 00:01:21.339 --> 00:01:22.730 You lie. 13 00:01:25.980 --> 00:01:27.370 You lie! 14 00:01:35.139 --> 00:01:36.540 <c.vtt_cyan>I never lie.</c>. 15 00:01:40.019 --> 00:01:41.410 Lend it to us! ··········································++- Traducción de la herramienta "trans": +++·········································· ufeffWEBVTT ... 9 [1m9[22m Translations of [4m9[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m9[24m [1m9[22m, [1mnine[22m 00:01:08.860 --> 00:01:10.770 [1m00:01:08.860 --> 00:01:10.770[22m Translations of [4m00:01:08.860 --> 00:01:10.770[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m00:01:08.860 --> 00:01:10.770[24m [1m00:01:08.860 --> 00:01:10.770[22m, [1m00:01:08,860 --> 00:01:10,770[22m ¿Tenéis testigos de lo que decís? [1mDo you have witnesses to what you say?[22m Translations of [4m¿Tenéis testigos de lo que decís?[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m¿Tenéis testigos de lo que decís?[24m [1mDo you have witnesses to what you say?[22m, [1mDo you have witnesses to what you are saying?[22m 10 [1m10[22m Translations of [4m10[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m10[24m [1m10[22m, [1mten[22m 00:01:12.180 --> 00:01:14.580 [1m00:01:12.180 --> 00:01:14.580[22m Translations of [4m00:01:12.180 --> 00:01:14.580[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m00:01:12.180 --> 00:01:14.580[24m [1m00:01:12.180 --> 00:01:14.580[22m, [1m00:01:12180 --> 00:01:14580.[22m <c.vtt_cyan>Si los muertos pudieran hablar, [1m<c.vtt_cyan>If the dead could speak,[22m Translations of [4m<c.vtt_cyan>Si los muertos pudieran hablar,[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m<c.vtt_cyan>Si los muertos pudieran hablar,[24m [1m<c.vtt_cyan>If the dead could speak,[22m, [1m<c.vtt_cyan>If the dead could talk, they[22m los tendría.</c> [1mI would have them.</c>[22m Translations of [4mlos tendría.</c>[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4mlos tendría.</c>[24m [1mI would have them.</c>[22m, [1mI would.</c>[22m 11 [1meleven[22m Translations of [4m11[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m11[24m [1meleven[22m, [1m11[22m 00:01:14.900 --> 00:01:16.300 [1m00:01:14.900 --> 00:01:16.300[22m Translations of [4m00:01:14.900 --> 00:01:16.300[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m00:01:14.900 --> 00:01:16.300[24m [1m00:01:14.900 --> 00:01:16.300[22m, [1m00:01:14,900 --> 00:01:16,300[22m Mentís. [1myou lie.[22m Definitions of [4mMentís.[24m [ [4mEspañol[24m -> [1mEnglish[22m ] verb [1m lie[22m mentir, estar, acostarse, yacer, encontrarse, descansar [1m tell a lie[22m mentir [1m prevaricate[22m prevaricar, mentir, tergiversar [1m fib[22m mentir, trapalear, decir mentirillas [4mMentís.[24m [1myou lie.[22m, [1mYou lie[22m 12 [1m12[22m Translations of [4m12[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m12[24m [1m12[22m, [1mTwelve[22m 00:01:21.339 --> 00:01:22.730 [1m00:01:21.339 --> 00:01:22.730[22m Translations of [4m00:01:21.339 --> 00:01:22.730[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m00:01:21.339 --> 00:01:22.730[24m [1m00:01:21.339 --> 00:01:22.730[22m, [1m00:01:21339 --> 00:01:22730.[22m Mentís. [1myou lie.[22m Definitions of [4mMentís.[24m [ [4mEspañol[24m -> [1mEnglish[22m ] verb [1m lie[22m mentir, estar, acostarse, yacer, encontrarse, descansar [1m tell a lie[22m mentir [1m prevaricate[22m prevaricar, mentir, tergiversar [1m fib[22m mentir, trapalear, decir mentirillas [4mMentís.[24m [1myou lie.[22m, [1mYou lie[22m 13 [1m13[22m Translations of [4m13[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m13[24m [1m13[22m, [1m#13[22m 00:01:25.980 --> 00:01:27.370 [1m00:01:25.980 --> 00:01:27.370[22m Translations of [4m00:01:25.980 --> 00:01:27.370[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m00:01:25.980 --> 00:01:27.370[24m [1m00:01:25.980 --> 00:01:27.370[22m, [1m-> 00:01:25.980[22m ¡Mentís! [1myou lie![22m Definitions of [4m¡Mentís![24m [ [4mEspañol[24m -> [1mEnglish[22m ] verb [1m lie[22m mentir, estar, acostarse, yacer, encontrarse, descansar [1m tell a lie[22m mentir [1m prevaricate[22m prevaricar, mentir, tergiversar [1m fib[22m mentir, trapalear, decir mentirillas [4m¡Mentís![24m [1myou lie![22m, [1mlie![22m 14 [1m14[22m Translations of [4m14[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m14[24m [1m14[22m, [1mfourteen[22m 00:01:35.139 --> 00:01:36.540 [1m00:01:35.139 --> 00:01:36.540[22m Translations of [4m00:01:35.139 --> 00:01:36.540[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m00:01:35.139 --> 00:01:36.540[24m [1m00:01:35.139 --> 00:01:36.540[22m, [1m-> 00:01:35.139 -->[22m <c.vtt_cyan>Yo nunca miento.</c> [1m<c.vtt_cyan>I never lie.</c>[22m Translations of [4m<c.vtt_cyan>Yo nunca miento.</c>[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m<c.vtt_cyan>Yo nunca miento.</c>[24m [1m<c.vtt_cyan>I never lie.</c>[22m 15 [1mfifteen[22m Translations of [4m15[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m15[24m [1mfifteen[22m, [1m15[22m 00:01:40.019 --> 00:01:41.410 [1m00:01:40.019 --> 00:01:41.410[22m Translations of [4m00:01:40.019 --> 00:01:41.410[24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m00:01:40.019 --> 00:01:41.410[24m [1m00:01:40.019 --> 00:01:41.410[22m, [1m00:01:40,019 --> 00:01:41,410[22m ¡Prendedlo! [1mturn it on![22m Translations of [4m¡Prendedlo![24m [ [4mEspañol[24m -> [1mEnglish[22m ] [4m¡Prendedlo![24m [1mturn it on![22m, [1mLight it![22m ··········································++- Bueno, pues me queda hacer la traducción con el cliente nativo de DeepL en una máquina de Windows virtual. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
On 2023-03-20 23:44, Juan Erbes wrote:
Enviado desde mi teléfono
...
Bueno, pues me queda hacer la traducción con el cliente nativo de DeepL en una máquina de Windows virtual.
Tal vez esta última opción funcione mejor. Yo he hecho traducciones con la web DeepL, que te limita a 5000 caracteres por tanda. Pero no deja de tener el problema de que toma cada línea de texto descontextualizada del resto de las líneas.
No me importa.
Si tienes tiempo prueba a generar nuevamente el texto a partir del audio que te da para descargar en formato vtt en el idioma que prefieras y no necesitas volver a traducirlo.
Joder, que no. Que el fichero de subtítulos en español lo tengo descargado de la productora que publica el video. No lo genero yo, lo hacen ellos, y no se toca. DeepL lo traduce *casi correctamente* al inglés. Lo único que necesito es automatizarlo. Eso es lo único que pregunto. Ya si quisiera (si me pagaran) pues entonces revisaba la traducción. Y compraba una licencia a DeepL. No voy a hacer la barbaridad de subir los videos a ningún lado para que reconozcan la voz y lo traduzcan. Ni de coña. Prohibido. Lo único que busco es automatizar la traducción de texto por DeepL, y la herramienta que publicaste el 2022-09-24, *no es DeepL*, y además, corrompe el formato del fichero de manera bestial. <https://lists.opensuse.org/archives/list/users-es@lists.opensuse.org/message/5KQYYY26GB6O7ZJHJ4MV2CYHJFS7MHM5/> From: Juan Erbes <jerbes@gmail.com> Date: Sat, 24 Sep 2022 10:45:23 -0300 Message-ID: <CACB8RRYk0yNpRkNuhEJvBUgz0aidRMUH-tAo7-LxAuWpg-wRVg@mail.gmail.com> Subject: Como instalar DeepL en Linux To: "opensuse-es@opensuse.org" <opensuse-es@opensuse.org> Así que probaré en Windows. [...] Efectivamente, en Windows funciona. Le doy el docx, y recibo el docx. Creo que puedo darle una tanda de ficheros y la aplicación lo hace todo, tarde lo que tarde. El siguiente paso es convertir de texto plano a docx, y viceversa, para meter en un script. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
El lun, 20 mar 2023 a las 20:25, Carlos E. R. (<robin.listas@telefonica.net>) escribió:
On 2023-03-20 23:44, Juan Erbes wrote:
Enviado desde mi teléfono
...
Bueno, pues me queda hacer la traducción con el cliente nativo de DeepL en una máquina de Windows virtual.
Tal vez esta última opción funcione mejor. Yo he hecho traducciones con la web DeepL, que te limita a 5000 caracteres por tanda. Pero no deja de tener el problema de que toma cada línea de texto descontextualizada del resto de las líneas.
No me importa.
Si tienes tiempo prueba a generar nuevamente el texto a partir del audio que te da para descargar en formato vtt en el idioma que prefieras y no necesitas volver a traducirlo.
Joder, que no. Que el fichero de subtítulos en español lo tengo descargado de la productora que publica el video. No lo genero yo, lo hacen ellos, y no se toca.
DeepL lo traduce *casi correctamente* al inglés. Lo único que necesito es automatizarlo. Eso es lo único que pregunto.
Ya si quisiera (si me pagaran) pues entonces revisaba la traducción. Y compraba una licencia a DeepL.
No voy a hacer la barbaridad de subir los videos a ningún lado para que reconozcan la voz y lo traduzcan. Ni de coña. Prohibido.
Lo único que busco es automatizar la traducción de texto por DeepL, y la herramienta que publicaste el 2022-09-24, *no es DeepL*, y además, corrompe el formato del fichero de manera bestial.
From: Juan Erbes <jerbes@gmail.com> Date: Sat, 24 Sep 2022 10:45:23 -0300 Message-ID: <CACB8RRYk0yNpRkNuhEJvBUgz0aidRMUH-tAo7-LxAuWpg-wRVg@mail.gmail.com> Subject: Como instalar DeepL en Linux To: "opensuse-es@opensuse.org" <opensuse-es@opensuse.org>
Así que probaré en Windows. [...] Efectivamente, en Windows funciona. Le doy el docx, y recibo el docx. Creo que puedo darle una tanda de ficheros y la aplicación lo hace todo, tarde lo que tarde.
El siguiente paso es convertir de texto plano a docx, y viceversa, para meter en un script.
¿Como te fue? Estaba de vacaciones y mucho no te pude ayudar desde el teléfono celular. Saludos, Juan -- USA LINUX OPENSUSE QUE ES SOFTWARE LIBRE, NO NECESITAS PIRATEAR NADA Y NI TE VAS A PREOCUPAR MAS POR LOS VIRUS Y SPYWARES: http://www.opensuse.org/es/ Puedes visitar mi blog en: http://jerbes.blogspot.com.ar/
On 2023-03-30 23:30, Juan Erbes wrote:
El lun, 20 mar 2023 a las 20:25, Carlos E. R. (<>) escribió:
On 2023-03-20 23:44, Juan Erbes wrote:
¿Como te fue?
Estaba de vacaciones y mucho no te pude ayudar desde el teléfono celular.
Está en segundo plano, tengo otras cosas más prioritarias. -- Cheers / Saludos, Carlos E. R. (from 15.4 x86_64 at Telcontar)
El jue, 30 mar 2023 a las 21:20, Carlos E. R. (<robin.listas@telefonica.net>) escribió:
On 2023-03-30 23:30, Juan Erbes wrote:
El lun, 20 mar 2023 a las 20:25, Carlos E. R. (<>) escribió:
On 2023-03-20 23:44, Juan Erbes wrote:
¿Como te fue?
Estaba de vacaciones y mucho no te pude ayudar desde el teléfono celular.
Está en segundo plano, tengo otras cosas más prioritarias.
Me volví a topar con algo similar utilizando Kate para "Unir líneas" y que DeepL haga una correcta traducción, y encontré esto: https://invent.kde.org/utilities/kate/-/merge_requests/823 Aparentemente lo habrían integrado en la versión oficial: https://invent.kde.org/utilities/kate/-/commit/3068a738eb60bfdabd02b387128be... Pero no la veo! Buscando en: https://software.opensuse.org/search?baseproject=ALL&q=Kate Uno de los resultados: https://software.opensuse.org/package/kate-python-plugins Sin detalles. Otra vez al método prueba y error! Salu2 -- USA LINUX OPENSUSE QUE ES SOFTWARE LIBRE, NO NECESITAS PIRATEAR NADA Y NI TE VAS A PREOCUPAR MAS POR LOS VIRUS Y SPYWARES: http://www.opensuse.org/es/ Puedes visitar mi blog en: http://jerbes.blogspot.com.ar/
participants (2)
-
Carlos E. R.
-
Juan Erbes