Sys.exit("ERROR: invalid offset resulting timestamp overflow") If ts.year != 2013 or ts.month != 1 or ts.day != 1: Ts = datetime.datetime(2013, 1, 1, ts, ts, ts, ts * 1000) # millisecond -> microsecondĭelta = datetime.timedelta(seconds = offset) Help = "show version information and quit") Parser.add_argument('-version', action = "version", version = "%(prog)s " + VERSION, Parser.add_argument('-o', '-overwrite', action = "store_true", default = False, Parser.add_argument('srt_file', type = file) Parser.add_argument('offset', type = float) Issue: the file in the repo doesn't contain any python format, so inĮnvironments like Windows it can't run without modifying its extension * You should have received a copy of the GNU General Public LicenseĪlong with this program if not, write to the Free Softwareįoundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. GNU General Public License for more details. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * This program is distributed in the hope that it will be useful,īut WITHOUT ANY WARRANTY without even the implied warranty of The Free Software Foundation either version 3, or (at your option) It under the terms of the GNU General Public License as published by * This program is free software you can redistribute it and/or modify To get started, create a python file namely srt-resync.py and store the following code on the file: """ To solve this issue we recommend you to copy the content of the main script and create your own python file as we are going to explain now. However, unless you are working in a Linux based environment, the script that you found in the repository won't work in windows correctly due to its functionality way (working as a bash executable), so if you try to run the script with python srt-resync in an environment like Windows, you will see an error of the main namespace. Creating the resync scriptĪ very nice implementation in Python that you can find to achieve this task, is the srt-resync project available at Github here. However, Our Code World is not about how to solve normal users problems right!? Are you trying to implement the same tool of the website that we recommend you previously? Then today is your lucky day as we'll explain you how to do it with an open source Python script. It can be used for synchronizing the subtitles to a movie when there is a slight offset between the two (this can be the case when the subtitles and the movie come from two different sources), or when there is a time scale difference (for instance if the movie and the subtitle file have different frame rates). The faster solution, is to use an online tool like this one offered by the guys at Bits'n'Bites that allows you to upload a SRT file and synchronize (shift) the time of the subtitles. These tools shift all the time stamps of a movie subtitle file. That's pretty useful, however the configuration will be stored in the player, so when you move the files of computer, you will see the problem with the subtitles again. As you can see, there's an area to delay the subtitles in a specified ammount of seconds. Nobody is downloading any pirate version of the John Wick moview here. Probably, you already use a player program that includes the feature to delay the time of the subtitles, for example with Power DVD 17, you can easily do it in the subtitles option: Unfortunately, the subtitles doesn't match with the parts where the actors speak. and the movie comes in a language that i don't understand, however the quality is without a doubt the best that you can't find on the internet, so you simply decide to keep the file and search for subtitles on the internet. I can't count all the times i downloaded a film.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |