cuzic/hardsub-ted
Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
TED の動画に対して、日本語字幕、英語字幕の両方を hardsub します。
使い方:
> rake setup # TED の動画のメタ情報を json ディレクトリに作成します。
> rake hardsub-all # TED の動画を作成します。
依存関係:
■ Ruby
◇ バージョン
Ruby 1.8.7 と Ruby 1.9.3 での動作を確認しています。
◇ Ruby の依存ライブラリ
rake 、 json 、 nokogiri が必要です。
> gem install rake json nokogiri
■ mencoder の依存関係
さらに hardsub のために mencoder が必要です。
◇ codec
特に x264 と faac が利用可能であることが必要です。
> mencoder -ovc help
Available codecs:
copy - frame copy, without re-encoding. Doesn't work with filters.
frameno - special audio-only file for 3-pass encoding, see DOCS.
raw - uncompressed video. Use fourcc option to set format explicitly.
lavc - libavcodec codecs - best quality!
vfw - VfW DLLs, read DOCS/HTML/en/encoding-guide.html.
qtvideo - QuickTime DLLs, currently only SVQ1/3 are supported.
xvid - XviD encoding
x264 - H.264 encoding
> mencoder -oac help
Available codecs:
copy - frame copy, without re-encoding (useful for AC3)
pcm - uncompressed PCM audio
mp3lame - cbr/abr/vbr MP3 using libmp3lame
lavc - FFmpeg audio encoder (MP2, AC3, ...)
twolame - Twolame MP2 audio encoder
faac - FAAC AAC audio encoder
◇ 字幕関係
mencoder で字幕をエンコードするために、 libfreetype とともに
mencoder がコンパイルされていることが必要です。
> mencoder -list-options
の実行結果を確認して、 ass 関係のオプションが有効か確認してください。
さらに、$HOME/.mplayer/subfont.ttf が存在していることが必要です。
TrueTypeFont については、自分の好みのものを使ってください。
作者は、Windows から Meirio UI フォントを持ってきて使っています。
■ ダウンロード
ほかに現在のバージョンではダウンロードに wget を使っています。
将来のバージョンでは、wget への依存をなくすかもしれません。
対象:
data.txt に書かれた URL の動画を収集対象とします。
data.txt がない場合は自動生成します。