LoginSignup
0
0

LibreOfficeのコマンドラインと字幕ファイルの翻訳と変換

Posted at

使用OS: Linux Minto 21.1
使用ソフト LibreOffice

米英テレビの番組が好きなので字幕を翻訳できないか考えてみる。最初はAoutkeyで考えて、手間がかかりそうとあきらめる。つぎはPandocはどだろうと思ったがMarkdownいいがSrtになるとOptionが多すぎで同じようにあきらめる。一番かんたんなLibreOfficeのコマンドラインに落ちつく。

3つの処理が必要です。

次の命令がメインなります。コンソールとブラウザーを使います。

soffice --headless --convert-to

流れ

1. srtファイルをdocxファイルに変換する。

soffice  --headless --convert-to docx *.srt

2. docxファイルを翻訳する。

Google翻訳
https://translate.google.com/?source=gtx&sl=en&tl=ja&op=docs

3. docxファイルをsrtファイルに変換する。

soffice --headless --convert-to "srt:Text (encoded):UTF8" *.docx 

ここで出来たSrtを動画へはめ込みます。

以上
参考サイト

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0