Giter VIP home page Giter VIP logo

laughing-batman's Introduction

laughing-batman

This is a script that splits film using the ffmpeg library.

##Usage

python main.py INPUT-FILE TIMES-FILE OUTPUT-FILE

where TIMES-FILE is a csv file of start times and durations such as

17:35, 8
21:50, 8
27:55, 12
37:50, 9
39:30, 12

##Notes

This perhaps could have been done more efficiently and/or eloquently using bash instead of python. Oh well.

I'm sure there also could have been more efficient ways to use ffmpeg.

##Workflow

# create a file for each split
ffmpeg -ss 100 -i emerson.mp4 -t 15 input1.mp4
ffmpeg -ss 204 -i emerson.mp4 -t 15 input2.mp4

# convert splits to .mpg
ffmpeg -i input1.mp4 -qscale:v 1 intermediate1.mpg
ffmpeg -i input2.mp4 -qscale:v 1 intermediate2.mpg

# join videos
cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg

# convert back to .mp4
ffmpeg -i intermediate_all.mpg -qscale:v 2 output.mp4

# clean up
rm input*
rm intermediate_all.mpg

laughing-batman's People

Contributors

haosharon avatar

Stargazers

 avatar

Watchers

James Cloos 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.