Giter Club home page Giter Club logo

magicrip's Introduction

Mike's Automagic DVD Ripper Script
==================================

Overview
--------

This python script uses lsdvd and HandBrakeCLI to automate the process
of ripping DVDs. Without any options it will scan the DVD for the
longest video track ("title" in DVD language) and rip it at full
resolution using h264 and include all of the audio and subtitle tracks.
The output will be a mkv file, with the filename derived from the title
of the DVD which comes from the DVD's metadata. Since the title provided
is only useful half the time at best the script asks for confirmation.

The default audio track is the first English track found. If a different
language is preferred (you don't want a crappy English dub on a foreign
film) change the preferred language with --alang. When the default
language is not English the first English subtitle track is enabled by
default. The preferred subtitle language can be changed with --slang.
Note that currently audio is "downmixed" to Dolby Pro Logic II and
re-encoded (HandBrake's default). Since many DVDs include several
surround formats the current situation winds up with several nearly
identical audio tracks. In the future I may figure out a good way to
guess which tracks are duplicates and which are legitimately different
such as an unlabeled commentary track.

At the end of the rip the file gets run through mkvmerge to make sure
the default tracks are selected properly and adds metadata tags with the
title. (Not many apps actually use mkv metadata but it makes me feel
better about myself.)


Requirements:
-------------

- lsdvd
- HandBrakeCLI (http://handbrake.fr/)
- mkvinfo/mkvmerge (mkvtoolnix)

Note that the last release of HandBrake doesn't have packages available
for recent distributions but svn snapshot builds are provided and work
just fine as of this writing.

On Ubuntu::
    add-apt-repository ppa:stebbins/handbrake-snapshots
    apt-get update
    apt-get install handbrake-cli lsdvd mkvtoolnix


Known Issues/To Do
------------------

- Sometimes lsdvd and HandBrake disagree on the number of audio tracks.
  Recent versions of HandBrakeCLI have a --scan option which could be
  useful for replacing most or all of lsdvd's use, I'll do it some day.
  As a work around specify the correct audio tracks with -A.

- HandBrake has a feature to scan the DVD for subtitles that should be
  enabled by default for brief foreign language segments. However so far
  I have only found one DVD that had a track the scan enabled and even
  then it didn't seem to do the right thing. The code is still there but
  disabled. Are there DVDs that this feature actually works for?

- In reality a lot of what this script does should actually be in
  HandBrakeCLI instead. Again, I'll do it some day.

- Duplicate audio tracks should be removed. The others should be
  identified in mkv's metadata. Many but not all DVDs are good about
  tagging which audio tracks are Director's Commentary.


Usage
-----

Go full automagic::

    rip

Set the title::

    rip --title "This awesome movie"

Choose only a few chapters::

    rip --chapters 1-5

Switch default audio to French (--slang en is the default so English
subtitles will turn on)::

    rip --alang fr

Choose your own audio and subtitle tracks::

    rip --audio 1,4 --subtitles 1,2

magicrip's People

Contributors

marineam avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

magicrip's Issues

failed to parse mkvinfo

Hello,
I'm running Debian Stable (7) and when I run the script I get

xpd259@mars:~$ rip.py -d /dev/sr1 -D Videos/
libdvdread: Using libdvdcss version 1.2.13 for DVD access
Title [Down]: 
Title: Down
Track: 2
File: Down.mkv
Default Audio: en
Default Subtitles: en
Video: 2, Length: 01:28:1.010, Chapters: 16
Audio: 1, Language: en, Content: Undefined (default)
Subtitle: 1, Language: en, Content: Undefined
Running: HandBrakeCLI --output=/home/xpd259/Videos/.Down.mkv --large-file --input=/dev/sr1 --preset=High Profile --subtitle-burn=none --audio=1 --aencoder=faac --mixdown=dpl2 --subtitle=1 --subtitle-default=None --title=2
[21:34:19] hb_init: starting libhb thread
HandBrake svn5850 (2013102201) - Linux x86_64 - http://handbrake.fr
6 CPUs detected
Opening /dev/sr1...
[21:34:19] CPU: AMD Phenom(tm) II X6 1090T Processor
[21:34:19]  - logical processor count: 6
...
...
Lots more output
...
...
Encode done!

HandBrake has exited.
failed to parse mkvinfo

are you also getting this or am I just lucky :)
I sadly don't know enough about python yet to read and understand the code

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.