AWS 推出了 Live 時全自動上字幕的功能

AWS 推出了在直播時就自動上字幕的功能:「Introducing Live Streaming with Automated Multi-Language Subtitling」,其實就是把現有的服務兜出來:「Live Streaming with Automated Multi-Language Subtitling」。

The solution deploys Live Streaming on AWS which includes AWS Elemental MediaLive, MediaPackage, Amazon CloudFront. The solution also deploys AWS Lambda, Amazon Simple Storage Service, Amazon Transcribe, and Amazon Translate.

對於比較沒那麼要求翻譯品質的情況也許可以玩看看...?

自動校正字幕時間的軟體 subsync

看到用 Python 寫的「smacke/subsync」這個軟體,可以自動校正字幕時間:

Language-agnostic automatic synchronization of subtitles to video, so that subtitles are aligned to the correct starting point within the video.

他把上面這個變成下面這個:

因為不是用 machine learning 所以速度意外的快。演算法是對影片本身產生一個 array,然後對字幕也產生 array,最後對兩個 array 用個簡單的公式校準:

  • Discretize video and subtitles by time into 10ms windows.
  • For each 10ms window, determine whether that window contains speech. This is trivial to do for subtitles (we just determine whether any subtitle is "on" during each time window); for video, use an off-the-shelf voice activity detector (VAD) like the one built into webrtc.
  • Now we have two binary strings: one for the subtitles, and one for the video. Try to align these strings by matching 0's with 0's and 1's with 1's. We score these alignments as (# matching digits) - (# mismatched digits).

就這樣解決問題 XD

把嵌上去的字幕重新轉回文字

雖然這篇用的方法很簡單,但因為太符合本 blog 的副標,所以還是寫下來介紹:「Extracting Chinese Hard Subs from a Video, Part 1」。

作者想要把字幕拉出來,他直接把這張圖丟進 OCR,然後失敗 XDDD:

他決定拉出下半段:

再做 thresholding:

最後再 OCR 取得文字:

′…′二′′′'′ 怎么去逯么远的地方 '/′

雖然很粗糙,但已經可以感覺到「幹壞事是進步最大的原動力」的感覺了 XDDD 而且看起來會有續集,會用比較精緻的技巧來處理?

直接從 IMDb 編號看影片

看到「Now Anyone Can Embed a Pirate Movie in a Website」這邊介紹的東西,直接輸入 IMDb 的編號 (包括 tt 開頭的那串編號),他就自動拉出 embed code:

然後可以直接線上觀看:

然後還支援字幕 (唔):

Interestingly, should one of those sources be Google Video, Vodlocker says its player offers Chromecast and subtitle support.

官網有寫來源是到處找:

VoDLocker searches all general video hosters like youtube, google drive, openload...

看起來整塊技術其實都是現成的。透過 search engine 加上定期的檢查機制與回報機制就可以做完 @_@