Git Product home page Git Product logo

vtrim's Introduction

VTrim

This is a simple Bash command line script that allows you to trim the first n1 and the last n2 seconds from a given video source.

Operation should be lossless, and very performant - as the operations do not transcode the video or audio source there is no loss of quality. On my mid-2012 MacBook Air assets process at approx 450x actual duration.

Requires

Assumes availability of ffmpeg and ffprobe in the same directory. Users do not need to be familiar with their operation, but should simply install the latest static build from FFMPEG.org

Usage

vtrim input-file n1 n2 [output-file]

  • input-file: this is the name of the source file
  • n1: initial trim point in seconds (can be in the format 1*60+14 for one minute and 14 seconds)
  • n2: number of seconds to trim off the end
  • output-file: you can optionaly specify the output file name. If not specified then it will take the input filename and make some changes (' - ' becomes '-' and spaces become underscores), and if the filename is the same as the input name, the script will rename the input and add 'in_' to the front.

Notes

  • While no transcoding takes place is the input and output file types match (eg mp4 to mp4, or mkv to mkv) if you make a change (eg mp4 to mkv) it will apply a conversion using default ffmpeg settings which will take much longer and will probably not give optimal results.
  • If ffmpeg and ffprobe are in a different directory (depends on install method), paths should be adjusted in the script to accomodate

To-Do

  • Resiliance: make code more able to handle errors (especially when ffmpeg or ffprobe are not present, or if the target filename when renaming already exists)
  • Add support for removing chapters that have a specific metatdata tag (eg 'advertisment')

If you make use of this and like it and want to give something back... I wrote a book! :)

Contribute

This project can be forked from [Github](https://github.com/Offbeatmammal/shVTrim. Please issue pull requests from feature branches.

License

See Licence file in repo, or refer to http://unlicense.org

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.