Giter Site home page Giter Site logo

avcut's Introduction

avcut

avcut is a ffmpeg-based video cutter that is able to do frame-accurate cuts of h264 streams (and possibly other codecs with or without inter-frame prediction) without reencoding the complete stream.

avcut always buffers a so-called group of pictures (GOP) and either copies all of the packets, if no cutting point lies in the corresponding time interval, or reencodes the frames of the GOP before or after the cutting point in order to resolve dependencies on frames that will be removed from the stream. Please see this blog article for a detailed description.

Please note:

  • This is an experimental version. Please check any resulting video if everything worked as intended. If you need a more mature solution, check avidemux.
  • You can specify an arbitrary output container that is supported by ffmpeg. However, avcut has only been tested with the Matroska (.mkv) container.

Dependencies

avcut also compiles with libav if you enable the flag in the Makefile but it has not been tested much.

Compilation

Install dependencies:

  • For Ubuntu versions with libav as default, e.g., 15.04:

    • apt-get install libavcodec-ffmpeg-dev libavformat-ffmpeg-dev libavutil-ffmpeg-dev
  • For Ubuntu with ffmpeg:

    • apt-get install libavcodec-dev libavformat-dev libavutil-dev
  • Gentoo:

    • emerge media-video/ffmpeg

Execute make to start building avcut. Execute make debug to build avcut with verbose output and debug symbols.

Usage

Usage: avcut [options] [<drop_from_ts> <continue_with_ts> ...]

Options:

  -c            Create a shell script to check cutpoints with mpv
  -d <diff>     Accept this difference in packet sizes during packet matching
  -i <file>     Input file
  -o <file>     Output file
  -p <profile>  Use this encoding profile. If <profile> ends with ".profile",
                <profile> is used as a path to the profile file. If not, the profile
                is loaded from the default profile directory:
                   /usr/share/avcut/profiles/
  -s <index>    Skip stream with this index
  -v <level>    Set verbosity level (see https://www.ffmpeg.org/doxygen/2.8/log_8h.html)

Besides the input and output file, avcut expects a "blacklist", i.e. what should be dropped, as argument. This blacklist consists of timestamps that denote from where to where frames have to be dropped. The last argument can be a hyphen to indicate that all remaining frames shall be dropped.

For example, to drop the frames of the first 10 seconds, the frames between 55.5s and 130s and all frames after 140s in input.avi and write the result to output.mkv, the following command can be used:

avcut -i input.avi -o output.mkv 0 10 55.5 130 140 -

The option -c causes avcut to create a shell script in the current working directory that will call mpv to play the video from 10 seconds before to 10 seconds after each cutting point.

avcut's People

Contributors

anyc avatar baskerville avatar billie80 avatar gcurse avatar monarc99 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.