Coder Social home page Coder Social logo

polypoyo / jumpcutter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gegell/jumpcutter

0.0 0.0 0.0 39 KB

Fast forward the silent and sounded parts of videos at different speeds. Explanation here: https://www.youtube.com/watch?v=DQ8orIurGxw

License: MIT License

Python 89.34% Nix 10.66%

jumpcutter's Introduction

Jumpcutter

Based on carykh's jumpcutter. It speeds up or slows down silent and louder parts of a video at different rates. This version reduces the work done by him as there were a few locations to optimize:

  1. He exported every frame to the tempfolder to manually drop or copy frames. This was removed and replaced by an automatically generated ffmpeg filter. More exactly: the setpts with a binary tree for the local speedup and offset of the audio chunks (thus running in O(n log n) and therefore may still be able to be improved by more ffmpeg magic).
  2. During the time change of the audio he called np.concatinate on the wav output, which lead to array copies and thus performed poorly with longer videos.
  3. During the audio time conversion he also created temporary files containing the current audio chunk. This was replaced by the ArrayReader and ArrayWriter to remove unnecessary file access.

There also were my own changes such as:

  1. Adding progressbars via the tqdm libary.
  2. Removing the youtube download function as in my opinion it did not fit in and could be substituted by something like youtube-dl.
  3. The ability to pass multiple input files and / or a directory with files to be converted.
  4. The ability to use the python file as a module.

Installing dependencies

To install the python libaries this script depends on, simply run pip install requirements.txt.

As it also relies heavily on ffmpeg, please make sure that it is installed and accesible over the commandline. See FFmpeg Website for information on how to install it.

Running it

To run it call python jumpcutter.py -h to get a help for the settings that you can pass to it.

To simply use default settings use python jumpcutter.py -i INPUT_FILE.

jumpcutter's People

Contributors

carykh avatar gegell avatar polypoyo avatar deflatedpickle avatar qixils 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.