GithubHelp home page GithubHelp logo

gregismotion / lazyshorts-py Goto Github PK

View Code? Open in Web Editor NEW
46.0 2.0 9.0 71 KB

Create short videos, like a lazy person.

License: GNU Lesser General Public License v3.0

Python 100.00%
ai ffmpeg instagram lazy mediapipe moviepy shorts tiktok video videos

lazyshorts-py's Introduction

See lazysys for the revamped version.


LazyShorts

A command-line tool to convert long-form videos into multiple short-form videos, with burned-in text and subtitles. It also cuts out unwanted silence.

Preview

Original video

original.mp4

Result (with manual subtitle correction)

corrected.mp4

Result (without manual subtitle correction)

As you can see, in Hungarian the medium model works quite well: considering the bad quality of my input. The large model could be even better: if you have the hardware. :)

whisper.mp4

Notes

Arguments

See lazyshorts -h

Subtitles

I use Whisper to transcribe audible voices to text.

Obviously with non-english languages the accuracy can be lower: you can help that by...

  • ...using a different (for now, only Whisper) model (be wary, the medium model is hard to run even with 8GBs of RAM.)
  • ...editing subtitles manually from segment to segment. ({lazyshorts-py} e1 2 45 78...)

Not tested

  • I don't know if running Whisper on GPU works, you could try CUDA. See --whisper_device and PyTorch/Whisper documentation. Also, get the CUDA enabled PyTorch as I define the CPU one in the requirements.txt.

Known issues

  • 'subprocess.run' somehow blocks UI process.
  • We could use rich to have nice progress bars, as currently you have to manually poll the status of the renders.
  • Cropping is just arbitrary: I wanted to use MediaPipe. It's not easy to even get it to run, but my resources were not enough. Maybe a less demanding model or cloud is needed?
  • Don't combine segments that are less than end_time, you'll get an exception.

lazyshorts-py's People

Contributors

gregismotion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.