The file 'ts_to_mkv.py', convert downloaded stream videos from internet which has '.ts' type, into 'mkv' format using 'MkvToolNix' software. When playing '.ts' files in video players and try to jump into another timeframe, using mouse or 'right' or 'left' arrows on keyboard, the video will accompanies with a 1 or 2 second lag. For fixing this issue one must change the codec into another video format. This code is written in order to fix this lag.
The 'MkvToolNix' has a graphical user interface that can do more, this code is just a try to convert lots of files that only needs change of codec and nothing more, with one click. Open the file in your editor, and provide the path for 'mkvmerge.exe' file. After that just run the code and provide the path that contains '.ts' files. It should be mentioned that this code only works for the path provided by user, and does not walk through subdirectories, and you should do this method for each directory separately.
The file ttml_to_srt.py tries to convert ttml subtitles provided by video sites such as youtube into '.srt' file. the ttml files sometimes contain two line subtitles that the upper one is for previous frame. This feature sometime is helpful, but most of times can cause headache (in my opinion). So this file also removes the overlap time between frames.