Viele DVDs mit Handbrake auf einmal rippen
Viele DVD Videodateien oder gar seine gesamte Videokollektion auf einmal zu konvertieren, etwa um weniger Platz auf der Festplatte zu verbrauchen, oder auch, um die DVDs überhaupt erstmal auf seiner Festplatte verfügbar zu haben, und so z. B. immer dabei zu haben, kann einen schon vor ein gewisses Problem stellen. Wie genau stelle ich es an, an dieser Operation so kurz wie nur möglich zu sitzen?
Gott sei dank gibt es durch Handbrake zusammen mit einer kleinen Batchdatei die Möglichkeit, beliebig viele DVD-Dateien auf einmal zu konvertieren – und so z. B. den PC über Nacht (oder über den Tag, wenn man unterwegs ist) rechnen zu lassen, ohne selbst jede einzelne Konvertierung manuell starten zu müssen.
Handbrake erlaubt als Eingabe sowohl normale Videodateien, wie auch DVD-Daten, also VIDEO_TS Ordner mit passendem Inhalt. Die beste Qualität bei gleichzeitig kleinster Dateigröße erzielt man mit einer Kombination von x264 Videocodec sowie AAC Audiocodec. Ob man etwas mehr Speicherplatz investiert, um die Qualität zu optimieren, eher Richtung minimaler Speicherplatz geht, oder mit einer mittleren Einstellung ein besonders gutes Verhältnis zwischen Speicherplatz und Qualität wählt, ist jedem selber überlassen. Dazu später mehr.
Vorbereitung: Installation von Handbrake
Zur Installation von HandBrake läßt sich nicht viel sagen. Datei passend runterladen (für viele Betriebssysteme verfügbar, wobei die Batchdatei unten für Windows programmiert ist) und installieren. Aktuell ist Version 0.9.5.
Kopieren der DVD Dateien
Als nächstes erzeugt man einen Ordner (z. B. c:Input), wo man später alle DVD Daten hineinkopiert. Und zwar folgendermaßen:
- Pro DVD einen Ordner erzeugen
- Ordner passend benamen. Der Ordnername wird später den Dateinamen ausmachen, typisch sollte man also den Ordner z. B. nach dem Film benennen.
- Von der DVD den VIDEO_TS Ordner in den neu erzeugten Unterordner kopieren
- Nächste DVD einlegen und von vorne anfangen, so lange noch DVDs nicht ausgelesen wurden.
Rippen einer DVD
Nun möchte man:
- Inhalt der Batchdatei in eine neu erstellte Datei, z. B. „run.bat” kopieren.
- Inhalt editieren: insbesondere müssen die Pfade angepasst werden (siehe Erklärungen).
- Evtl. noch Optionen anpassen.
- Batchdatei ausführen.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | REM @echo off REM # HandbrakeCLI Batch Conversion (Windows Batch File) REM # will search all subfolders for VIDEO_TS , then convert up to 25 titles per folder REM # -------------------------------------------------------------------------- REM # change these settings to suit what you're converting REM # when testing, set chapters to '-c 1-1' to save time set INPDIR=C:Input set OUTDIR=C:Output set PGMDIR=C:ProgrammeHandBrake set Tracks=(1,1,25) set Chapters= set PRESET=test set FileExt=mkv set EXTRA= -e x264 -q 0.53 -a 1 -E faac -B 160 -R 0 -6 dpl2 -D 1 -v -d slow -m -s "1, 2, 3, 4, 5" rem --width 640 rem --crop 1:1:6:6 for /d /r "%INPDIR%" %%i in (.) do if exist "%%~fiVIDEO_TS." for /l %%t in %Tracks% do if not exist "%OUTDIR%%%~ni-%%t %PRESET%.%FileExt%" TITLE Handbrake Source=%%~ni Track=%%t & ECHO. & ECHO *Source* %%~fiVIDEO_TS *Title* %%t & "%PGMDIR%HandbrakeCLI" -i "%%~fi" -t %%t %Chapters% -o "%OUTDIR%%%~ni-%%t %PRESET%.%FileExt%" -Z "%PRESET%" %EXTRA% 2>>%OUTDIR%convert.log echo *Finished* |
Erklärungen
Was editiert werden muß
- INPDIR: Ordner, der ganz zu Anfang erzeugt wurde, Eingabe
- OUTDIR: Ordner, in dem die Ergebnisse abgelegt werden
- PGMDIR: Ordner, in dem HandBrake installiert ist
Was editiert werden kann
- Tracks: Wie viele Tracks auf der DVD gesucht werden. Typischerweise weiß man nicht, wie viele Tracks auf einer DVD sein werden (alles soll generisch und automatisch funktionieren), so nimmt man mit 25 eine recht hohe Anzahl an, dies kann nach Belieben angepasst werden. Bis zu dieser Zahl werden alle Tracks berücksichtigt, sollten noch mehr Tracks vorhanden sein, werden diese ignoriert.
- FileExt: Dateierweiterung, bestimmt auch den Dateityp, z. B. .mkv oder .mp4.
- PRESET: Name der Voreinstellungen, die benutzt werden sollen (hiermit könnten wir uns viele Optionen in der Kommandozeile ersparen – gewinnen oder verlieren ansonsten aber nicht viel. Man sollte entweder komplett Kommandozeile oder komplett PRESET verwenden, um sich nicht selber zu verwirren, welche Option jetzt wo her kommt.)
Zusätzliche Optionen für Fortgeschrittene
- -q: Qualität, sollte typischerweise zwischen 0.5 und 0.55 sein. Je höher, desto besser die Qualität und größer die Dateien. 0.52-0.53 funktionieren gut.
- -a: Audiotrack, z.B. „-a 1, 2, 3” übernimmt die ersten 3 Audiotracks. Leider funktioniert das nur für vorhandene Audiotracks – hat man also DVDs mit einer unterschiedlichen Anzahl von Audiotracks und möchte alle mitnehmen, muß man seine Sammlung aufteilen.
- -e: Untertitel, Syntax wie bei -a, hier kann man beliebig viele angeben, es werden dann alle gefundenen übernommen.
- -E faac -B 160: Audioeinstellungen, schon ziemlich gute Qualität, durchaus für Musik geeignet, wenn man sich nicht gerade also audiophil bezeichnen würde. Sonst Bitrate erhöhen.
- -d slow: Deinterlace, dies wird oft für Material benötigt, das im Zeilensprungverfahren abgelegt ist, was bei DVDs fast immer der Fall ist. Ob das Material diese Einstellung benötigt sieht man z. B., wenn man sich am PC eine Scene mit z. B. einer schnellen Armbewegung anschaut, hier sieht man dann deutlich, daß das Bild aus Halbbildern (einem alten und einem neuen mit jeweils anderer Armposition) zusammengesetzt ist.
- -m: Kapitelmarker, damit man später im Videoplayer (z. B. VLC) zwischen verschiedenen Szenen springen kann.
- –crop 1:1:6:6: Abschneiden der Ränder, z. B. für analoge Aufnahmen mit Rauschen, oder wenn schwarze Balken (16:9) vorhanden sind. Wird hier autocrop angegeben, versucht HandBrake, automatisch die optimalen Ränder zu finden. Allerdings wird dann auch die Bildgröße der Ausgabedateien variieren.
Kurze Erlärung der Batchdatei
In der for-Schleife wird gecheckt, ob sich bereits eine Datei im Ausgabeordner befindet, so daß z. B. auch bei richtig großen Sammlungen die Batch gestoppt werden kann und später wieder aufgenommen werden kann. Hier muß nur die jeweils zuletzt erzeugte (unvollständige) Ausgabedatei gelöscht werden.
Sollte man während der Codierung mit dem Rechner weiter arbeiten wollen, so empfiehlt es sich, mit dem Taskmanager von Windows die Priorität der Prozesse zu erniedrigen – so merkt man in der täglichen Arbeit kaum einen Unterschied.
Anbei noch eine Liste aller Optionen für den Kommandozeilenaufruf von HandBrake.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | C:Programmehandbrake>handbrakecli --help Syntax: HandBrakeCLI [options] -i <device> -o <file> ### General Handbrake Options------------------------------------------------ -h, --help Print help -u, --update Check for updates and exit -v, --verbose <#> Be verbose (optional argument: logging level) -C, --cpu Set CPU count (default: autodetected) -Z. --preset <string> Use a built-in preset. Capitalization matters, and if the preset name has spaces, surround it with double quotation marks -z, --preset-list See a list of available built-in presets --no-dvdnav Do not use dvdnav for reading DVDs (experimental, enabled by default for testing) ### Source Options----------------------------------------------------------- -i, --input <string> Set input device -t, --title <number> Select a title to encode (0 to scan all titles only, default: 1) --scan Scan selected title only. --main-feature Detect and select the main feature title. -c, --chapters <string> Select chapters (e.g. "1-3" for chapters 1 to 3, or "3" for chapter 3 only, default: all chapters) --angle <number> Select the DVD angle --previews <#:B> Select how many preview images are generated (max 30 ), and whether or not they're stored to disk (0 or 1). (default: 10:0) --start-at-preview <#> Start encoding at a given preview. --start-at <unit:#> Start encoding at a given frame, duration (in second s), or pts (on a 90kHz clock) --stop-at <unit:#> Stop encoding at a given frame, duration (in seconds ), or pts (on a 90kHz clock) ### Destination Options------------------------------------------------------ -o, --output <string> Set output file name -f, --format <string> Set output format (mp4/mkv, default: autodetected from file name) -m, --markers Add chapter markers (mp4 and mkv output formats only ) -4, --large-file Use 64-bit mp4 files that can hold more than 4 GB. Note: Breaks iPod, PS3 compatibility. -O, --optimize Optimize mp4 files for HTTP streaming -I, --ipod-atom Mark mp4 files so 5.5G iPods will accept them ### Video Options------------------------------------------------------------ -e, --encoder <string> Set video library encoder (ffmpeg,x264,theora) (default: ffmpeg) -x, --x264opts <string> Specify advanced x264 options in the same style as mencoder: option1=value1:option2=value2 -q, --quality <number> Set video quality -S, --size <mb> Set target size -b, --vb <kb/s> Set video bitrate (default: 1000) -2, --two-pass Use two-pass mode -T, --turbo When using 2-pass use the turbo options on the first pass to improve speed (only works with x264, affects PSNR by about 0.05dB, and increases first pass speed two to four times) -r, --rate Set video framerate (5/10/12/15/23.976/24/25/29.97) Be aware that not specifying a framerate lets HandBrake preserve a source's time stamps, potentially creating variable framerate video --vfr, --cfr, --pfr Select variable, constant or peak-limited frame rate control. VFR preserves the source timing. CFR makes the output constant rate at the rate given by the -r flag (or the source's average rate if no -r is given). PFR doesn't allow the rate to go over the rate specified with the -r flag but won't change the source timing if it's below that rate. If none of these flags are given, the default is --cfr when -r is given and --vfr otherwise ### Audio Options----------------------------------------------------------- -a, --audio <string> Select audio track(s), separated by commas More than one output track can be used for one input. ("none" for no audio, "1,2,3" for multiple tracks, default: first one) -E, --aencoder <string> Audio encoder(s): (faac/lame/vorbis/ac3/copy/copy:ac3/copy:dts) copy, copy:ac3 and copy:dts meaning passthrough. copy will passthrough either ac3 or dts. Separated by commas for more than one audio track. (default: faac for mp4, lame for mkv) -B, --ab <kb/s> Set audio bitrate(s) (default: depends on the selected codec, mixdown and samplerate) Separated by commas for more than one audio track. -6, --mixdown <string> Format(s) for surround sound downmixing Separated by commas for more than one audio track. (mono/stereo/dpl1/dpl2/6ch, default: up to 6ch for a c3, up to dpl2 for other encoders) -R, --arate Set audio samplerate(s) (22.05/24/32/44.1/48 kHz) Separated by commas for more than one audio track. -D, --drc <float> Apply extra dynamic range compression to the audio, making soft sounds louder. Range is 1.0 to 4.0 (too loud), with 1.5 - 2.5 being a useful range. Separated by commas for more than one audio track. -A, --aname <string> Audio track name(s), Separated by commas for more than one audio track. ### Picture Settings--------------------------------------------------------- -w, --width <number> Set picture width -l, --height <number> Set picture height --crop <t:B:L:R> Set cropping values (default: autocrop) -Y, --maxHeight <#> Set maximum height -X, --maxWidth <#> Set maximum width --strict-anamorphic Store pixel aspect ratio in video stream --loose-anamorphic Store pixel aspect ratio with specified width --custom-anamorphic Store pixel aspect ratio in video stream and directly control all parameters. --display-width Set the width to scale the actual pixels to <number> at playback, for custom anamorphic. --keep-display-aspect Preserve the source's display aspect ratio when using custom anamorphic --pixel-aspect Set a custom pixel aspect for custom anamorphic <parx:PARY> (--display-width and --pixel-aspect are mutually exclusive and the former will override the latter) --itu-par Use wider, ITU pixel aspect values for loose and custom anamorphic, useful with underscanned sources --modulus Set the number you want the scaled pixel dimensions <number> to divide cleanly by. Does not affect strict anamorphic mode, which is always mod 2 (default: 16) -M --color-matrix Set the color space signaled by the output <601 or 709> (Bt.601 is mostly for SD content, Bt.709 for HD, default: set by resolution) ### Filters--------------------------------------------------------- -d, --deinterlace Deinterlace video with yadif/mcdeint filter <ym:FD:MM:QP> (default 0:-1:-1:1) or <fast/slow/slower> -5, --decomb Selectively deinterlaces when it detects combing <mo:ME:MT:ST:BT:BX:BY:MG:VA:LA:DI:ER:NO:MD:PP:FD> (default: 7:2:6:9:80:16:16:10:20:20:4:2:50:24:1:-1) -9, --detelecine Detelecine (ivtc) video with pullup filter Note: this filter drops duplicate frames to restore the pre-telecine framerate, unless you specify a constant framerate (--rate 29.97) <l:R:T:B:SB:MP:FD> (default 1:1:4:4:0:0:-1) -8, --denoise Denoise video with hqdn3d filter <sl:SC:TL:TC> (default 4:3:6:4.5) or <weak/medium/strong> -7, --deblock Deblock video with pp7 filter <qp:M> (default 5:2) --rotate Flips images axes <m> (default 3) -g, --grayscale Grayscale encoding ### Subtitle Options------------------------------------------------------------ -s, --subtitle <string> Select subtitle track(s), separated by commas More than one output track can be used for one input. Example: "1,2,3" for multiple tracks. A special track name "scan" adds an extra 1st pass. This extra pass scans subtitles matching the language of the first audio or the language selected by --native-language. The one that's only used 10 percent of the time or less is selected. This should locate subtitles for short foreign language segments. Best used in conjunction with --subtitle-forced. -F, --subtitle-forced Only display subtitles from the selected stream if <string> the subtitle has the forced flag set. The values in "string" are indexes into the subtitle list specified with '--subtitle'. Separated by commas for more than one audio track. Example: "1,2,3" for multiple tracks. If "string" is omitted, the first track is forced. --subtitle-burn "Burn" the selected subtitle into the video track <number> If "number" is omitted, the first track is burned. "number" is an index into the subtitle list specified with '--subtitle'. --subtitle-default Flag the selected subtitle as the default subtitle <number> to be displayed upon playback. Setting no default means no subtitle will be automatically displayed If "number" is omitted, the first track is default. "number" is an index into the subtitle list specified with '--subtitle'. -N, --native-language Specifiy the your language preference. When the firs t <string> audio track does not match your native language then select the first subtitle that does. When used in conjunction with --native-dub the audio track is changed in preference to subtitles. Provide the language's iso639-2 code (fre, eng, spa, dut, et cet era) --native-dub Used in conjunction with --native-language requests that if no audio tracks are selected the default selected audio track will be the first one that matches the --native-language. If there are no matching audio tracks then the first matching subtitle track is used instead. --srt-file <string> SubRip SRT filename(s), separated by commas. --srt-codeset Character codeset(s) that the SRT file(s) are <string> encoded in, separted by commas. Use 'iconv -l' for a list of valid codesets. If not specified latin1 is assumed --srt-offset Offset in milli-seconds to apply to the SRT file(s) <string> separted by commas. If not specified zero is assumed . Offsets may be negative. --srt-lang <string> Language as an iso639-2 code fra, eng, spa et cetera ) for the SRT file(s) separated by commas. If not spec ified then 'und' is used. --srt-default Flag the selected srt as the default subtitle <number> to be displayed upon playback. Setting no default means no subtitle will be automatically displayed If "number" is omitted, the first srt is default. "number" is an 1 based index into the srt-file list |
Ich freue mich über Rückmeldungen sowie weitere Tips.
2 thoughts on “Viele DVDs mit Handbrake auf einmal rippen”
wow… Danke, dein Script hat mir eben super geholfen und ist schon mal ein riesen Schrit für mich in die richtige Richtung, denn mein NAS platzt aus allen Nähten 😉
Ich hätte noch zwei Anregungen die die Arbeit super erleichtern würden:
1.) Dateibenennung: es wäre super, wenn der Name (in Bezug auf den %title% nicht aufgebaut wäre „beispielname-1.mp4“, sondern immer „beispielname 01.mp4“ (bzw. mit underlines statt Leerzeichen, da Windowssysteme und viele Mediaplayer bekanntlich ab 10 immer falsch sortieren würden.
2.) könnte man das ganze auch für Files mit .ISO erweitern statt des Video_TS Ordners, denn diese lassen sich ja auch direkt öffnen? würde eine Menge Kopierarbeit sparen 😉
Viele Grüße und super Arbeit !!! Uwe