Coder Social home page Coder Social logo

lith-x / extract-dialogue Goto Github PK

View Code? Open in Web Editor NEW

This project forked from brennier/extract-dialogue

0.0 0.0 0.0 44 KB

A shell script that uses subtitle timestamps to extract only the dialogue from a video.

License: GNU General Public License v2.0

Shell 100.00%

extract-dialogue's Introduction

extract-dialogue

Uses subtitle timestamps to extract the dialogue from an .mkv file. This script is written in plain Bourne Shell. The only dependency is ffmpeg.

First, ffmpeg is used to extract the subtitle file from the .mkv file. It then splits and converts the audio track of the .mkv file according to the timestamps of the subtitle file. This requires the subtitles in a text-based format (i.e. subtitles that are in the format .ass, .ssa, or .srt). The audio cuts are then concatenated and written to the output filename (default is output.mp3).

Options

There are several options that you can specify:
       -i Specify the video input
       -a Specify the audio track number to use
       -s Either specify the subtitle track number to use or specify the filename of an external subtitle file
       -o Specify the output filename
       -p Specify padding (in milliseconds) around subtitle timestamps; must be less than 1000
       -k Keep intermediate files stored under /tmp; useful for debugging purposes
       -h Display usage message

Only the -i option is required. If not specified, the default behavior is to use the first audio track and the first subtitle track. The default output name is simply the name of the video file with the extension changed to .mp3. The default padding is 100 milliseconds. Similar to ffmpeg, the extension of the output name determines the format of the output.

Future Plans

  • Add command line options to specify the audio and subtitles track
  • Add option to specify output name
  • Automatically merge overlapping timestamps (especially when using padding)
  • Add option to use an external subtitles file
  • Add the option to pad the timestamps in the subtitles file
  • Improve subtitle parsing
  • Improve documentation and error-handling
  • Parse bitmap-based subtitle files

extract-dialogue's People

Contributors

brennier avatar edulim 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.