Code Monkey home page Code Monkey logo

srtmod's Introduction

A simple Python tool to do basic subtitle modifications

This is a standalone Python 3 script to modify .srt subtitle files by

  • shifting subtitles to the front or back
  • modifying subtitle speed
Usage: srtmod.py [<delta>][@<time>] [<delta>][@<time>]
	delta:  One of '+number', '-number' where number is the amount of milliseconds to move the subtitles to the back. If omitted, "+0" is assumed.
	time:   Timestamp in format hh:mm:ss to denote the point at which the denoted shift is desired.
	        If omitted, "00:00:00" is assumed.

By giving two operations with different times, subtitles may be slowed down or sped up.
Subtitles are read from stdin.
Examples:
	Move subs one second to the front everywhere: srtmod.py -1000 < subtitles.srt
	Move subs 500ms to the front at 10min but keep the timing at 5min (speeding them up in result): srtmod.py @5:00 -500@10:00 < subtitles.srt

Notes:

  • If you shift subtitles before the beginning, they will wrap around to 23 hours 59 minutes and vice versa. The ordering will not be adjusted. Therefore durations longer than 24 hours are not supported.
  • Subtitles containing " --> " will cause a failure.

srtmod's People

Contributors

wmbr avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.