どんどん字幕を作ろう makroo produkti subtitolon
2015.01.19
カテゴリ:PC
どんどん字幕を作ろう makroo produkti subtitolon
動画に字幕をつけるExcelマクロです。
1~2行……メモです
A……メモです
B……(開始)時間
C……(開始)分
D……(開始)秒
E……(開始)1000分の1秒
F……このまま(-->)
G……(終了)時間
H……(終了)分
I……(終了)秒
J……(終了)1000分の1秒
K……字幕1行目
L……字幕2行目
M……マクロ「subtitolo」を実行した場合、結果が入る。
字幕作成
このマクロは直接srtファイルを作成し、デスクトップに出力します。
Sub 字幕作成() '字上符文字が文字化けするのでエスペラントには向かない Let dosiero = Cells(1, 1) Open "C:\Users\user\Desktop\" & dosiero & ".srt" For Output As #1 Let tate = 3 Let ici = tate - 2 While Cells(tate, 11) <> Empty Print #1, tate - 2 Print #1, Cells(tate, 2); ":"; Cells(tate, 3); ":"; Cells(tate, 4); ","; Cells(tate, 5); Print #1, " "; Cells(tate, 6); " "; Print #1, Cells(tate, 7); ":"; Cells(tate, 8); ":"; Cells(tate, 9); ","; Cells(tate, 10) Print #1, Cells(tate, 11) If Cells(tate, 12) <> Empty Then Print #1, Cells(tate, 12) End If Print #1, "" Let tate = tate + 1 Wend Close #1 End Sub
aldoni subtitolon
出力結果がMカラムに出るので、コピーして拡張子.srtをつけて保存すること。
ĉi tiu makroo produktas la rezulton ĉe kolumno M.
ĝin kopiu al dosiero, aldonante sufikson ".srt".
Sub subtitolo() 'aldoni subtitolon al filmo. ' rezulto aperos cxe M-kolumno. '(C)belmonto, 2014-12-04T17:45 Let tate = 3 Let linio = 3 Let yoko = 13 While Cells(tate, 11) <> Empty Let Cells(linio, yoko) = tate - 2 Let linio = linio + 1 Let Cells(linio, yoko) = Cells(tate, 2) & ":" & Cells(tate, 3) & ":" & _ Cells(tate, 4) & "," & Cells(tate, 5) & _ " " & Cells(tate, 6) & " " & _ Cells(tate, 7) & ":" & Cells(tate, 8) & ":" & Cells(tate, 9) & "," & Cells(tate, 10) Let linio = linio + 1 Let Cells(linio, yoko) = Cells(tate, 11) If Cells(tate, 12) <> Empty Then Let linio = linio + 1 Let Cells(linio, yoko) = Cells(tate, 12) End If Let tate = tate + 1 Let linio = linio + 2 Wend End Sub
- 動画とこのsrtファイルを同じフォルダに置きます。
再生ソフト側で字幕ファイルを選択してください。
自動的に読み込むソフトもあります。
拡張子はsrtですが、中身は次のようなテキストです。
1 00:00:02,000 --> 00:00:05,000 2012年夏 初めてベトナムへ 2 00:00:05,000 --> 00:00:08,000 どこにハノイがあるかわかりますか? 時差は2時間あります 3 00:00:08,000 --> 00:00:16,000 画面に入るように横長にしてみました 東が上です ハノイは左 4 00:00:16,000 --> 00:00:24,000 左にハノイ。 右の島々が 世界自然遺産ハロン湾です 5 00:00:24,000 --> 00:00:32,000 これがハノイ(河内)市の全景
a:2461 t:1 y:1