Tuesday, March 19, 2013

Closed Captions, Hard-Subtitles/Soft-Subtitles


There are two types in embedded subtitles: Hard-subs and Soft-subs.

• Hard-subs
  - It is merged to video frames.
  - It can NOT be removed and modified, hided.
  - It requires video track re-encoding. (So it takes very LONG times to add subtitles.)
  - Decoding video frame > Creating subtitle image > Merge both into one frame > Encoding video frame.

• Soft-subs
  - It is inserted to a separated track.
  - It can be removed by removing the subtitle track and be hided.
  - It doesn't require video track re-encoding. (So it takes very SHORT times to add subtitles. It's very efficient.)
  - Just add subtitle track into the container (M4V, MP4 or MOV).

'Closed Captions (CC)' is 'Soft-subs'. And there are some restrictions by OS X / iOS.
  - Font type and size used in 'Closed Captions' are determined by OS X / iOS.
  - Supported tags and subtitles position are limited. 
  - So it can't be displayed as the MKV's embedded subtitles (SSA, ASS with embedded 'ttf' fonts).

※ It can now change the style of 'Closed Captions' on OS X 10.9 or later, iOS 7.0 or later, Apple TV 6.0 or later. But if changed style is applied, color tags in CC are ignored at Apple TV.
• OS X: 'System Preferences' - Accessibility - Captions - Click '+' button
 iOS (Apple TV): 'Settings' - General - Accessibility - Subtitles & Captioning - Style - Create New Style (Edit Styles)

So, MKV2M4V doesn't support 'Hard-subs' way because of these reasons.


MKV2M4V adds 'CC' into the target file (M4V, MP4 or MOV) using SRT subtitle files without video track re-encoding (So it's very fast). 

If it chose the 'ssa', 'ass' or 'subrip' subtitle track, first, it is converted to SRT subtitle file without embedded 'ttf' fonts because of the reasons described above. And then if another srt files don't exist, this SRT subtitle file will be used in adding 'Closed Caption'.



The following is the explanation on how to add 'Closed Caption' and turn on it.

First, there are some restrictions by 'Sandbox'. Sandboxed-app can't open files without the user's explicit access. So, if it opens not folders but video files, srt files should be in the following folders or its subfolders to use them automatically. If not, it should open it manually; Folders that once opened while the app is running, MKV2M4V’s the place to save. 

Next files are in '/Users/bohoonkim/Movies/test' folder. And in this case, 'video_file_name.srt' and 'video_file_name*.srt' files can be used for adding 'CC' when it converts 'Sample.mkv' file.


But if it explicitly opens only 'Sample.mkv' file, it can't access these srt files.


Thus it should explicitly open three files or '/Users/bohoonkim/Movies/test' folder to access them.


'Sample.mkv' and two srt files were opened. (These SRT files' text encoding is UTF-16. Of course it also supports UTF-8.)


If 'CC' was successfully added, 'Caption.' will be displayed as the following after conversion.


And then, this converted file, 'Sample.m4v' was played on QuickTime Player and turn on 'CC' by using 'balloon' button in the control bar. (on OS X 10.10.x)


And screenshot with another converted file on iTunes. (on OS X 10.10.x)




No comments:

Post a Comment