本來這個blog是記錄開發輸入法的點滴的,後來越來越雜,現在什麼都記錄了。

2014年12月20日 星期六

How to convert TV program to mkv file with subtitle and everything?

This is an example recorded with Magic TV recorder. The movie recorded is "Life of Pi".

  1. Save the recorded program in a USB stick. Copy the *.ts file to d:\temp  and rename it to Pi.ts
     
  2. Use  Handbrake to convert it to a MKV file.

    • De-interlace

       
    • Add all the audio's

       
    • Destination set to "d:\temp\Pi.mkv"
       
    • Start convert.
     
  3. Subtitle handling. Download Project X - DVB demux Tool

    • Drag d:\temp\Pi.ts to it.
       
       
    • Goto PreSettings menu. Choose only to output subtitle:


       
    • Subtitle settings:


       
    • Start convert by clicking "Quick start" and you should get the following files:

      Pi.sup.idx, Pi.sup.sub, Pi-02.sup.idx, Pi-02-sup.sub
       
     
  4. Fix the problem (color and time) of the subtitles. Download VobSub.
     
    • Open SubResync under VobSub. Drag Pi.sup.idx to it. The subtitle color is not correct and the subtitle is not clear.

       
    • Open P1.sup.idx with Notepad. The color index is:
       
      ...
      time offset: 0
      forced subs: OFF
      palette: 000060, 2b2b2b, 2c2c2c, 535353, 353535, 414141, 636363, 7d7d7d, c9c9c9, 8f8f8f, dbdbdb, a9a9a9, ebebeb, 9c9c9c, b8b8b8, 2b2b2b
      custom colors: OFF, tridx: 1000, colors: 600000, 101010, ffffff, a9a9a9
      langidx: 0
      id: --, index: 0

      ....

      By experiment, it is noted that the color marked in red above are the outline of the characters. Suggest to change it to pure black 000000.
      Change the rest to white (ffffffff), i.e.

      palette: 000000, 000000, 000000, ffffff, ffffff, ffffff, ffffff, ffffff, ffffff, ffffff, ffffff, ffffff, ffffff, ffffff, ffffff, 000000

       
       

    • It is also noted that the timestamp of the subtitle is incorrect.
      Example the first valid subtitle extracted is at 00:09:57.807


      But it actually happens at 00:05:52.500 in the movie (by manually playing the P1.mkv file generated)
      To fix it, double right click the circle of the subtitle item until it becomes a download triangle.
      And type in the correct time.


         
      Save the subtitle as Pi-1-final.idx / sub.

       
    • Do the same to other subtitle Pi-02.sup.idx/sub. Save as Pi-2-final.idx/sub

       
  5. Put the subtitle in the P1mkv file. Download mkvmerge
     
    • Open it. Add Pi-1-final.idx/sub Pi-2-final.idx/sub

       
    • Start muxing as P1-subtitled.mkv
       
    • The final movie has everything:
       

沒有留言: