[Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Discussion of the HandBrake command line interface (CLI)
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
AlBundy
Bright Spark User
Posts: 370
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by AlBundy » Sat Jan 11, 2014 6:11 pm

I've uploaded a new version with minor changes in console-output and ctrl-c handling

Al

olmo
Posts: 7
Joined: Sun Jan 12, 2014 3:23 pm

Re: [Script] rip all episodes or only main-feature from DVD

Post by olmo » Sun Jan 12, 2014 4:42 pm

Hi all,
I'm new in this forum. Al, your "little" program is just what I was looking for..thank you! I've tested the prog with some files and it works perfectly.

Now I wanted to try the preset function with a plist-file exported with the HandBrake-GUI. Here my steps:
1. I downloaded and installed "plist" gem (within ruby folder)
2. exported an own preset-file, named 123.plist and saved the file in the same folder as hb.rb

Now, how do I access to this preset in the command line?
I tried with:
C:\handbrake\hb.rb --input C:\z_video_bearbeitung\temp\test\*.mkv --output C:\z_video_bearbeitung\temp\test\output\#title#.mkv --lang eng,deu --preset 123
but i just get
unkown preset 123 (no big surprise because (correct me if i'm wrong) --preset is valid only for the built-in presets)

Did I miss any changes to the user-preset feature? Or is there a misunderstanding on my side?
Thanks!

olmo

AlBundy
Bright Spark User
Posts: 370
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by AlBundy » Sun Jan 12, 2014 5:35 pm

--preset is used for built-in and plist-presets.
Name of the preset to use is not the file name - you have to use the real preset-name.

If you run hb.rb --help a list of known presets will be displayed.

Al

olmo
Posts: 7
Joined: Sun Jan 12, 2014 3:23 pm

Re: [Script] rip all episodes or only main-feature from DVD

Post by olmo » Mon Jan 13, 2014 1:29 pm

thanks for your reply. I tried again but it's still not working for me.
Here the plist:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist>
  <array>
    <dict>
      <key>AudioList</key>
      <array>
        <dict>
          <key>AudioBitrate</key>
          <string>160</string>
          <key>AudioEncoder</key>
          <string>Auto Passthru</string>
          <key>AudioMixdown</key>
          <string>Dolby Pro Logic II</string>
          <key>AudioSamplerate</key>
          <string>Auto</string>
          <key>AudioTrack</key>
          <integer>0</integer>
          <key>AudioTrackDRCSlider</key>
          <real>0</real>
          <key>AudioTrackDescription</key>
          <string>Unknown</string>
          <key>AudioTrackGainSlider</key>
          <real>0</real>
        </dict>
        <dict>
          <key>AudioBitrate</key>
          <string>160</string>
          <key>AudioEncoder</key>
          <string>Auto Passthru</string>
          <key>AudioMixdown</key>
          <string>Dolby Pro Logic II</string>
          <key>AudioSamplerate</key>
          <string>48</string>
          <key>AudioTrack</key>
          <integer>0</integer>
          <key>AudioTrackDRCSlider</key>
          <real>0</real>
          <key>AudioTrackDescription</key>
          <string>Unknown</string>
          <key>AudioTrackGainSlider</key>
          <real>0</real>
        </dict>
      </array>
      <key>AudioAllowAACPass</key>
      <integer>1</integer>
      <key>AudioAllowAC3Pass</key>
      <integer>1</integer>
      <key>AudioAllowDTSHDPass</key>
      <integer>1</integer>
      <key>AudioAllowDTSPass</key>
      <integer>1</integer>
      <key>AudioAllowMP3Pass</key>
      <integer>1</integer>
      <key>AudioEncoderFallback</key>
      <string>AC3 (ffmpeg)</string>
      <key>ChapterMarkers</key>
      <integer>1</integer>
      <key>Default</key>
      <integer>0</integer>
      <key>FileFormat</key>
      <string>MKV file</string>
      <key>Folder</key>
      <false />
      <key>Mp4HttpOptimize</key>
      <integer>0</integer>
      <key>Mp4LargeFile</key>
      <integer>0</integer>
      <key>Mp4iPodCompatible</key>
      <integer>0</integer>
      <key>PictureAutoCrop</key>
      <integer>1</integer>
      <key>PictureBottomCrop</key>
      <integer>0</integer>
      <key>PictureDeblock</key>
      <integer>4</integer>
      <key>PictureDecomb</key>
      <integer>0</integer>
      <key>PictureDecombCustom</key>
      <string />
      <key>PictureDecombDeinterlace</key>
      <integer>1</integer>
      <key>PictureDeinterlace</key>
      <integer>0</integer>
      <key>PictureDeinterlaceCustom</key>
      <string />
      <key>PictureDenoise</key>
      <integer>0</integer>
      <key>PictureDenoiseCustom</key>
      <string />
      <key>PictureDetelecine</key>
      <integer>0</integer>
      <key>PictureDetelecineCustom</key>
      <string />
      <key>PictureHeight</key>
      <integer>0</integer>
      <key>PictureKeepRatio</key>
      <integer>0</integer>
      <key>PictureLeftCrop</key>
      <integer>0</integer>
      <key>PictureModulus</key>
      <integer>2</integer>
      <key>PicturePAR</key>
      <integer>2</integer>
      <key>PictureRightCrop</key>
      <integer>0</integer>
      <key>PictureTopCrop</key>
      <integer>0</integer>
      <key>PictureWidth</key>
      <integer>0</integer>
      <key>PresetBuildNumber</key>
      <string>2013052900</string>
      <key>PresetDescription</key>
      <string>No Description</string>
      <key>PresetName</key>
      <string>Test</string>
      <key>Type</key>
      <integer>1</integer>
      <key>UsesMaxPictureSettings</key>
      <integer>1</integer>
      <key>UsesPictureFilters</key>
      <integer>1</integer>
      <key>UsesPictureSettings</key>
      <integer>2</integer>
      <key>VideoAvgBitrate</key>
      <string />
      <key>VideoEncoder</key>
      <string>H.264 (x264)</string>
      <key>VideoFramerate</key>
      <string>Same as source</string>
      <key>VideoFramerateMode</key>
      <string>vfr</string>
      <key>VideoGrayScale</key>
      <integer>0</integer>
      <key>VideoQualitySlider</key>
      <real>20</real>
      <key>h264Level</key>
      <string>4.0</string>
      <key>x264OptionExtra</key>
      <string />
      <key>x264Preset</key>
      <string>veryfast</string>
      <key>h264Profile</key>
      <string>main</string>
      <key>x264Tune</key>
      <string>none</string>
      <key>x264UseAdvancedOptions</key>
      <integer>0</integer>
      <key>VideoQualityType</key>
      <integer>2</integer>
      <key>VideoTargetSize</key>
      <string />
      <key>VideoTurboTwoPass</key>
      <integer>0</integer>
      <key>VideoTwoPass</key>
      <integer>0</integer>
      <key>x264Option</key>
      <string />
    </dict>
  </array>
</plist>
So the real name in this case is "Test" (from key PresetName), right?
And this I got from --help

Code: Select all

C:\handbrake>hb.rb --help
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
iconv will be deprecated in the future, use String#encode instead.
hb.rb Copyright (C) 2014 AlBundy
This program comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt.
This is free software, and you are welcome to redistribute it under certain cond
itions.

For questions, feature-requests etc. visit: https://forum.handbrake.fr/viewtopic
.php?f=10&t=26163

Usage: hb [options]

common
        --input INPUT                input-source
        --output OUTPUT              output-file (mp4, m4v and mkv supported)
                                     available place-holders
                                     #pos#             - title-number on input-s
ource
                                     #size#            - resolution
                                     #fps#             - frames per second
                                     #ts#              - current timestamp
                                     #title#           - source-title (dvd-label
, directory-basename, filename)
                                     #source#          - name of input
                                     #source_basename# - name of input without e
xtension
                                     #source_dirname#  - path to the input-file
        --force                      force override of existing files
        --check                      show only available titles and tracks
        --help                       Display this screen

output-options
        --compatibility              enables iPod compatible output (only m4v an
d mp4)
        --autocrop                   automatically crop black bars
        --max-width WIDTH            maximum video width (e.g. 1920, 1280, 720)
        --max-height HEIGTH          maximum video height (e.g. 1080, 720, 576)
        --audio LANGUAGES            the audio languages
        --subtitles LANGUAGES        the subtitle languages
        --lang LANGUAGES             sets audio and subtitle languges
        --audio-track SETTINGS       the audio-settings to use
                                     allowed options
                                     encoder - the audio encoder to use (allowed
: copy, auto, faac, ffaac, ffac3, lame, vorbis, ffflac, ffflac24, default: copy)

                                     mixdown - allowed: auto, mono, left_only, r
ight_only, stereo, dpl1, dpl2, 5point1, 6point1, 7point1, 5_2_lfe), default: aut
o)
                                     bitrate - the bitrate to use (default: 160k
b/s)
                                     codec - the codec-filter to apply (regular
expression)
                                     language - the language-filter to apply (sp
ace separated)
        --audio-settings SETTINGS    encoding settings for auto-encoder dependin
g on audio-type
                                     allowed options
                                     track - regular expression for track (use *
 to set default settings)
                                     encoder - the audio encoder to use (allowed
: copy, faac, ffaac, ffac3, lame, vorbis, ffflac, ffflac24)
                                     mixdown - allowed: auto, mono, left_only, r
ight_only, stereo, dpl1, dpl2, 5point1, 6point1, 7point1, 5_2_lfe))
                                     bitrate - the bitrate to use
        --preset PRESET              the handbrake-preset to use
                                     allowed: Android, Android Tablet, AppleTV,
AppleTV 2, AppleTV 3, High Profile, Normal, Universal, iPad, iPhone & iPod touch
, iPod)
        --preview [RANGE]            convert only a preview in RANGE (default: 0
0:01:00-00:02:00)

filter-options
        --main                       main-feature only
        --titles TITLES              the title-numbers to convert (use --check t
o see available titles)
        --chapters CHAPTERS          the chapters to convert (e.g. 2 or 3-4)
        --min-length DURATION        the minimum-track-length - format hh:nn:ss
        --max-length DURATION        the maximum-track-length - format hh:nn:ss
        --skip-duplicates            skip duplicate titles (checks block-size)
        --only-first-track-per-language
                                     convert only first audio-track per language

        --skip-commentaries          ignore commentary-audio- and subtitle-track
s

options passed through handbrake (see handbrake-help for info)
        --large-file
        --encopts OPTIONS
        --quality QUALITY
        --[no-]decomb
        --[no-]detelecine
        --[no-]loose-anamorphic

logging
        --log [LOGFILE]              write all output to LOGFILE
        --log-override               always override logfile
        --log-overview LOGFILE       write additional overview-file
        --create-encode-log          create the handbrake encode-log based on th
e outputfile-name

expert-options
        --loops LOOPS                processes input LOOPS times (default: 1)
        --wait LOOPS                 retries LOOPS times to wait for input (defa
ult: unlimited)
        --xtra ARGS                  additional arguments for handbrake
        --debug                      enable debug-mode (doesn't start conversion
)
        --verbose                    enable verbose output
        --testdata FILE              read info from/write info to file
        --x264-profile PRESET        use x264-profile (baseline, main, high, hig
h10, high422, high444)
        --x264-preset PRESET         use x264-preset (ultrafast, superfast, very
fast, faster, fast, medium, slow, slower, veryslow, placebo)
        --x264-tune OPTION           tune x264 (film, animation, grain, stillima
ge, psnr, ssim, fastdecode, zerolatency)

commands to run after input was processed
        --input-done-cmd COMMAND     runs user defined COMMAND (use #file# as pl
aceholder)
        --input-move TARGETDIR       moves file to TARGETDIR
        --input-delete               deletes file
        --input-copy TARGETDIR       copies file to TARGETDIR
        --input-eject                eject tray

commands to run after output was created
        --output-done-cmd COMMAND    runs user defined COMMAND (use #file# as pl
aceholder)
        --output-move TARGETDIR      moves file to TARGETDIR
        --output-copy TARGETDIR      copies file to TARGETDIR

shorts
        --audio-copy                 sets: --audio-track encoder=copy
        --audio-mixdown              sets: --audio-track encoder=ca_aac,mixdown=
dpl2
        --movie                      sets: --default --main
        --episodes                   sets: --default --min-length 00:10:00 --max
-length 00:50:00 --skip-duplicates
        --default                    sets: --audio deu,eng --subtitles deu,eng -
-audio-copy --skip-commentaries --only-first-track-per-language
        --bluray                     sets: --no-decomb --no-detelecine --no-loos
e-anamorphic

hints:
use raw disk devices (e.g. /dev/rdisk1) to ensure that libdvdnav can read the ti
tle
see https://forum.handbrake.fr/viewtopic.php?f=10&t=26165&p=120036#p120035

examples:
convert main-feature with all original-tracks (audio and subtitle) for languages
 german and english
hb.rb --input /dev/rdisk1 --output "~/Movie.m4v" --movie

convert all episodes with all original-tracks (audio and subtitle) for languages
 german and english
hb.rb --input /dev/rdisk1 --output "~/Series_SeasonX_#pos#.m4v" --episodes

convert complete file or DVD with all tracks, languages etc.
hb.rb --input /dev/rdisk1 --output "~/Output_#pos#.m4v"

convert MKV, add at first the english mixed down track and after that the copied
 english and german track
hb.rb --input ~/mymovie.mkv --output "~/Output_#pos#.m4v" --audio-track encoder=
ca_aac,mixdown=dpl2,language=eng --audio-copy

convert all local DVDs recursive in a directory
hb.rb --input "~/DVD/**/VIDEO_TS" --output "~/#title#_#pos#.m4v"

convert all MKVs in a directory
hb.rb --input "~/MKV/*.mkv" --output "~/#title#.m4v"

convert 10 DVDs, eject disc when done (OSX) and wait for next
hb.rb --input /dev/rdisk1 --output "~/#title_#pos#.m4v" --movie --preset "Androi
d Mid" --loops 10 --input-done-cmd "drutil tray eject"
And here the installed gems:

Code: Select all

C:\Ruby193\bin>gem list

*** LOCAL GEMS ***

bigdecimal (1.1.0)
io-console (0.3)
json (1.5.5)
minitest (2.5.1)
plist (3.1.0)
rake (0.9.2.2)
rdoc (3.9.5)
Anything else I should observe?

olmo

AlBundy
Bright Spark User
Posts: 370
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by AlBundy » Mon Jan 13, 2014 1:46 pm

Seems that the preset was not loaded.
Have you stored the file in the same folder as hb.rb?

olmo
Posts: 7
Joined: Sun Jan 12, 2014 3:23 pm

Re: [Script] rip all episodes or only main-feature from DVD

Post by olmo » Mon Jan 13, 2014 1:56 pm

yes

Code: Select all

C:\handbrake>dir
 Volume in Laufwerk C: hat keine Bezeichnung.
 Volumeseriennummer: 0ECF-E7EA

 Verzeichnis von C:\handbrake

13.01.2014  14:54    <DIR>          .
13.01.2014  14:54    <DIR>          ..
11.01.2014  19:02             3.832 hb.rb
11.01.2014  23:02    <DIR>          lib
15.09.2013  01:08            35.147 LICENSE.txt
05.10.2013  19:00             2.268 readme.txt
23.11.2013  02:22             4.403 tag_episode.rb
13.01.2014  14:27             4.995 Test.plist
13.01.2014  13:27    <DIR>          tools
               5 Datei(en),         50.645 Bytes
               4 Verzeichnis(se), 129.866.878.976 Bytes frei
it's the Test.plist file

AlBundy
Bright Spark User
Posts: 370
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by AlBundy » Mon Jan 13, 2014 2:14 pm

I've tried it successfully on OSX with your file

Code: Select all

...
        --preset PRESET              the handbrake-preset to use
                                     allowed: Android, Android Tablet, AppleTV, AppleTV 2, AppleTV 3, High Profile, Normal, Test, Universal, iPad, iPhone & iPod touch, iPod)
...
you can try this:
open hb_lib.rb and replace

Code: Select all

begin
  #https://trac.handbrake.fr/browser/trunk/scripts/manicure.rb
  require File.join(File.dirname(__FILE__), "manicure.rb")
  CAN_LOAD_PLIST = true
rescue LoadError
  CAN_LOAD_PLIST = false
end
with

Code: Select all

  require File.join(File.dirname(__FILE__), "manicure.rb")
  CAN_LOAD_PLIST = true
Now you should get see an error if a gem is missing

olmo
Posts: 7
Joined: Sun Jan 12, 2014 3:23 pm

Re: [Script] rip all episodes or only main-feature from DVD

Post by olmo » Mon Jan 13, 2014 3:27 pm

I receive this message:

Code: Select all

C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
cannot load such file -- C:/handbrake/lib/manicure.rb (LoadError)
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i
n `require'
        from C:/handbrake/lib/hb_lib.rb:5:in `<top (required)>'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i
n `require'
        from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i
n `require'
        from C:/handbrake/hb.rb:4:in `<main>'

AlBundy
Bright Spark User
Posts: 370
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by AlBundy » Mon Jan 13, 2014 6:18 pm

And does the file C:/handbrake/lib/manicure.rb exist?

[edit]no it does not[/edit]

AlBundy
Bright Spark User
Posts: 370
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by AlBundy » Mon Jan 13, 2014 7:47 pm

I've uploaded a new version.

olmo
Posts: 7
Joined: Sun Jan 12, 2014 3:23 pm

Re: [Script] rip all episodes or only main-feature from DVD

Post by olmo » Mon Jan 13, 2014 7:58 pm

thx for your effort!
this time i get this error:

Code: Select all

C:/Ruby193/lib/ruby/gems/1.9.1/gems/plist-3.1.0/lib/plist/parser.rb:91:in `scan'
: incompatible encoding regexp match (UTF-8 regexp with CP850 string) (Encoding:
:CompatibilityError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/plist-3.1.0/lib/plist/parser.rb
:91:in `parse'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/plist-3.1.0/lib/plist/parser.rb
:29:in `parse_xml'
        from C:/handbrake/lib/hb_lib.rb:522:in `loadPlist'
        from C:/handbrake/lib/hb_lib.rb:462:in `block in getPresets'
        from C:/handbrake/lib/hb_lib.rb:461:in `glob'
        from C:/handbrake/lib/hb_lib.rb:461:in `getPresets'
        from C:/handbrake/lib/hb_lib.rb:227:in `block in parseArgs'
        from C:/Ruby193/lib/ruby/1.9.1/optparse.rb:882:in `initialize'
        from C:/handbrake/lib/hb_lib.rb:170:in `new'
        from C:/handbrake/lib/hb_lib.rb:170:in `parseArgs'
        from C:/handbrake/hb.rb:14:in `<main>'

AlBundy
Bright Spark User
Posts: 370
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by AlBundy » Mon Jan 13, 2014 8:15 pm

Can you check the encoding of your plist file (should be UTF-8)?
Does you plist-file contain german umlauts or other special characters?

olmo
Posts: 7
Joined: Sun Jan 12, 2014 3:23 pm

Re: [Script] rip all episodes or only main-feature from DVD

Post by olmo » Mon Jan 13, 2014 9:06 pm

alright, it's working! had to change the encoding of the exported plist from UTF-8 to UTF-8 without BOM (??).
The plist file I use is the Test.plist from above. With this plist the prg seems to double the audio tracks:

Code: Select all

[2014-01-13, 21:57:58]  WARN -- hb.rb:   audio-tracks
[2014-01-13, 21:57:58]  WARN -- hb.rb:     - track 1: English () - original
[2014-01-13, 21:57:58]  WARN -- hb.rb:     - track 1: English (Dolby Pro Logic I
I) - original
[2014-01-13, 21:57:58]  WARN -- hb.rb:     - track 2: Deutsch () - original
[2014-01-13, 21:57:58]  WARN -- hb.rb:     - track 2: Deutsch (Dolby Pro Logic I
I) - original

AlBundy
Bright Spark User
Posts: 370
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by AlBundy » Mon Jan 13, 2014 9:41 pm

As far as I can see you've added the first track twice with the same settings?

Have you done some special settings in this preset?

If not you can also try the switches from hb.rb to convert your files.

olmo
Posts: 7
Joined: Sun Jan 12, 2014 3:23 pm

Re: [Script] rip all episodes or only main-feature from DVD

Post by olmo » Mon Jan 13, 2014 9:58 pm

I will test a few things with these presets.
One of your switches has almost the settings I need, so maybe I'll go for that.

Thanks again for your support! Great program!

AlBundy
Bright Spark User
Posts: 370
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by AlBundy » Mon Jan 13, 2014 10:01 pm

Your welcome.

Eelisland
Posts: 7
Joined: Thu Jan 23, 2014 2:21 pm

Re: [Script] rip all episodes or only main-feature from DVD

Post by Eelisland » Fri Jan 24, 2014 3:21 pm

Hello Al,

First many thanks for your script, very very usefull :)

I can't figure how to use an exported plist preset, i'm using Slackware linux i have Plist installed but i'm a little bit lost in translation (English is not my native language). Do i have to install with gem a specific plist to use within ruby? Do you know how i can do this on Linux please ? I can use native Preset succesfully.

Slackware libplist

Code: Select all

locate libplist
/usr/lib64/libplist++.so
/usr/lib64/libplist.so
/usr/lib64/pkgconfig/libplist.pc
/usr/lib64/pkgconfig/libplist++.pc
/usr/lib64/libplist++.so.1.1.4
/usr/lib64/libplist++.so.1
/usr/lib64/libplist.so.1.1.4
/usr/lib64/libplist.so.1
/usr/doc/libplist-1.4
/usr/doc/libplist-1.4/COPYING.LESSER
/usr/doc/libplist-1.4/README
/usr/doc/libplist-1.4/COPYING
/usr/doc/libplist-1.4/AUTHORS
/var/log/packages/libplist-1.4-x86_64-1
/var/log/removed_scripts/libplist-1.3-x86_64-1-upgraded-2012-12-16,16:49:30
/var/log/scripts/libplist-1.4-x86_64-1
/var/log/removed_packages/libplist-1.3-x86_64-1-upgraded-2012-12-16,16:49:30
output of gem list:

Code: Select all

gem list

*** LOCAL GEMS ***

bigdecimal (1.1.0)
io-console (0.3)
json (1.5.5)
minitest (2.5.1)
rake (0.9.2.2)
rdoc (3.9.5)

My plist preset in same folder as hb.rb, is there a probleme with UTF-8 language, no specific chars is used actually.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
	<dict>
		<key>AudioAllowAACPass</key>
		<true />
		<key>AudioAllowAC3Pass</key>
		<true />
		<key>AudioAllowDTSHDPass</key>
		<true />
		<key>AudioAllowDTSPass</key>
		<true />
		<key>AudioAllowMP3Pass</key>
		<true />
		<key>AudioEncoderFallback</key>
		<string>AC3 (ffmpeg)</string>
		<key>AudioList</key>
		<array>
			<dict>
				<key>AudioBitrate</key>
				<string>160</string>
				<key>AudioEncoder</key>
				<string>AAC (faac)</string>
				<key>AudioEncoderActual</key>
				<string>faac</string>
				<key>AudioMixdown</key>
				<string>Dolby Pro Logic II</string>
				<key>AudioSamplerate</key>
				<string>Auto</string>
				<key>AudioTrack</key>
				<integer>1</integer>
				<key>AudioTrackDRCSlider</key>
				<real>0</real>
				<key>AudioTrackDescription</key>
				<string>Francais (AC3) (5.1 ch)</string>
				<key>AudioTrackGain</key>
				<real>0</real>
				<key>AudioTrackName</key>
				<string></string>
				<key>AudioTrackQuality</key>
				<real>-1</real>
				<key>AudioTrackQualityEnable</key>
				<false />
			</dict>
		</array>
		<key>ChapterMarkers</key>
		<true />
		<key>Default</key>
		<false />
		<key>FileFormat</key>
		<string>MP4 file</string>
		<key>Folder</key>
		<false />
		<key>Mp4HttpOptimize</key>
		<false />
		<key>Mp4LargeFile</key>
		<true />
		<key>Mp4iPodCompatible</key>
		<false />
		<key>PictureAutoCrop</key>
		<true />
		<key>PictureBottomCrop</key>
		<integer>0</integer>
		<key>PictureDeblock</key>
		<integer>4</integer>
		<key>PictureDecomb</key>
		<integer>0</integer>
		<key>PictureDecombCustom</key>
		<string></string>
		<key>PictureDecombDeinterlace</key>
		<true />
		<key>PictureDeinterlace</key>
		<integer>0</integer>
		<key>PictureDeinterlaceCustom</key>
		<string></string>
		<key>PictureDenoise</key>
		<integer>0</integer>
		<key>PictureDenoiseCustom</key>
		<string></string>
		<key>PictureDetelecine</key>
		<integer>0</integer>
		<key>PictureDetelecineCustom</key>
		<string></string>
		<key>PictureHeight</key>
		<integer>720</integer>
		<key>PictureKeepRatio</key>
		<true />
		<key>PictureLeftCrop</key>
		<integer>0</integer>
		<key>PictureLooseCrop</key>
		<false />
		<key>PictureModulus</key>
		<string>2</string>
		<key>PicturePAR</key>
		<string>2</string>
		<key>PicturePARHeight</key>
		<integer>400</integer>
		<key>PicturePARWidth</key>
		<integer>399</integer>
		<key>PictureRightCrop</key>
		<integer>0</integer>
		<key>PictureTopCrop</key>
		<integer>0</integer>
		<key>PictureWidth</key>
		<integer>1280</integer>
		<key>PresetBuildNumber</key>
		<integer>2014012299</integer>
		<key>PresetDescription</key>
		<string>HandBrake&apos;s settings for playback on the iPad (all generations).</string>
		<key>PresetName</key>
		<string>iPad-Lee</string>
		<key>SubtitleList</key>
		<array>
		</array>
		<key>Type</key>
		<integer>1</integer>
		<key>UsesPictureFilters</key>
		<integer>1</integer>
		<key>UsesPictureSettings</key>
		<integer>1</integer>
		<key>VideoAvgBitrate</key>
		<integer>2500</integer>
		<key>VideoEncoder</key>
		<string>H.264 (x264)</string>
		<key>VideoFramerate</key>
		<string>30</string>
		<key>VideoFramerateMode</key>
		<string>pfr</string>
		<key>VideoGrayScale</key>
		<false />
		<key>VideoQualitySlider</key>
		<real>20</real>
		<key>VideoQualityType</key>
		<integer>2</integer>
		<key>VideoTargetSize</key>
		<integer>700</integer>
		<key>VideoTurboTwoPass</key>
		<false />
		<key>VideoTwoPass</key>
		<false />
		<key>h264Level</key>
		<string>3.1</string>
		<key>h264Profile</key>
		<string>high</string>
		<key>lavcOption</key>
		<string></string>
		<key>x264Option</key>
		<string></string>
		<key>x264OptionExtra</key>
		<string></string>
		<key>x264Preset</key>
		<string>medium</string>
		<key>x264Tune</key>
		<string>none</string>
		<key>x264UseAdvancedOptions</key>
		<false />
	</dict>
</array>
</plist>
I have modified hb_lib.rb as indicated in a previous post and tryed a preset, also iPad-Lee preset don't appear on hb.rb --help

Code: Select all

hb.rb --input /home/toto/Movie/test.mkv --output /home/toto/Movie/test.iPad.mkv --preset iPad-Lee
/usr/lib64/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': /home/toto/.ruby-handbrake/lib/hb_lib.rb:1387: syntax error, unexpected $end, expecting keyword_end (SyntaxError)
        from /usr/lib64/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from ./hb.rb:4:in `<main>'

AlBundy
Bright Spark User
Posts: 370
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by AlBundy » Fri Jan 24, 2014 6:03 pm

According to the readme ;-) you have to install the plist-gem with

Code: Select all

gem install plist
After that hb.rb --help should display your preset in available presets.

Al

Eelisland
Posts: 7
Joined: Thu Jan 23, 2014 2:21 pm

Re: [Script] rip all episodes or only main-feature from DVD

Post by Eelisland » Fri Jan 24, 2014 6:45 pm

Hello Al,

Many thanks for very quick reply and sorry, i'have read every post of the forum and forget the readme :oops:

I have installed plist as root

Code: Select all

gem install plist
Fetching: plist-3.1.0.gem (100%)
Successfully installed plist-3.1.0
1 gem installed
Installing ri documentation for plist-3.1.0...
Installing RDoc documentation for plist-3.1.0...

Code: Select all

gem list

*** LOCAL GEMS ***

bigdecimal (1.1.0)
io-console (0.3)
json (1.5.5)
minitest (2.5.1)
plist (3.1.0)
rake (0.9.2.2)
rdoc (3.9.5)
I get this error:

Code: Select all

bash-4.2$ hb.rb --help
/usr/lib64/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': iconv will be deprecated in the future, use String#encode instead.
hb.rb Copyright (C) 2014 AlBundy
This program comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt.
This is free software, and you are welcome to redistribute it under certain conditions.

For questions, feature-requests etc. visit: https://forum.handbrake.fr/viewtopic.php?f=10&t=26163

/home/toto/.ruby-handbrake/lib/manicure.rb:841:in `generateCLIParse': undefined method `to_i' for true:TrueClass (NoMethodError)
        from /home/toto/.ruby-handbrake/lib/manicure.rb:158:in `displayIndividualPreset'
        from /home/toto/.ruby-handbrake/lib/manicure.rb:120:in `block in displayCommandStrings'
        from /home/toto/.ruby-handbrake/lib/manicure.rb:115:in `each'
        from /home/toto/.ruby-handbrake/lib/manicure.rb:115:in `displayCommandStrings'
        from /home/toto/.ruby-handbrake/lib/manicure.rb:108:in `initialize'
        from /home/toto/.ruby-handbrake/lib/hb_lib.rb:498:in `initialize'
        from /home/toto/.ruby-handbrake/lib/hb_lib.rb:523:in `new'
        from /home/toto/.ruby-handbrake/lib/hb_lib.rb:523:in `loadPlist'
        from /home/toto/.ruby-handbrake/lib/hb_lib.rb:462:in `block in getPresets'
        from /home/toto/.ruby-handbrake/lib/hb_lib.rb:461:in `glob'
        from /home/toto/.ruby-handbrake/lib/hb_lib.rb:461:in `getPresets'
        from /home/toto/.ruby-handbrake/lib/hb_lib.rb:227:in `block in parseArgs'
        from /usr/lib64/ruby/1.9.1/optparse.rb:882:in `initialize'
        from /home/toto/.ruby-handbrake/lib/hb_lib.rb:170:in `new'
        from /home/toto/.ruby-handbrake/lib/hb_lib.rb:170:in `parseArgs'
        from ./hb.rb:14:in `<main>' 
Any other info i can provide? again many thanks for your help.

Eelisland
Posts: 7
Joined: Thu Jan 23, 2014 2:21 pm

Re: [Script] rip all episodes or only main-feature from DVD

Post by Eelisland » Fri Jan 24, 2014 7:11 pm

I have deleted my preset and created a new one, everything works, much thanks for your script and help.
regards.

AlBundy
Bright Spark User
Posts: 370
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by AlBundy » Fri Jan 24, 2014 7:33 pm

I've already uploaded a new version which should also work with your old script.
Did you use different version of handbrake between not-working and working plist?

Eelisland
Posts: 7
Joined: Thu Jan 23, 2014 2:21 pm

Re: [Script] rip all episodes or only main-feature from DVD

Post by Eelisland » Fri Jan 24, 2014 9:15 pm

Thanks for the update.

I use same Handbrake version(rev5474 (x86_64)). Prior testing my plist preset, i have manually edited the preset file with KDE Kwrite editor to change:

Code: Select all

      <string>iPad</string>
to

Code: Select all

      <string>iPad-Lee</string>
Changed the filename from iPad to iPad-Lee and saved.

for testing i have downloaded your new script version(backup my old version), restore from trash the iPad-Lee.plist in hb.rb folder and test the command hb.rb --help and it works fine.

Georges Orwell
Posts: 4
Joined: Thu Jan 30, 2014 9:00 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by Georges Orwell » Thu Jan 30, 2014 9:32 am

Hi,

With your script, i would like use this command with sub-folders

Code: Select all

hb.rb --input "e:\iso\*.iso" --output "e:\mkv\#source_basename#.mkv" --main --audio-copy --xtra "--quality 19.0 
--strict-anamorphic --x264-profile high --x264-preset medium --x264-tune film"
so, i use

Code: Select all

hb.rb --input "e:\iso\**\*.iso" --output "e:\mkv\#source_basename#.mkv" --main --audio-copy --xtra "--quality 19.0 
--strict-anamorphic --x264-profile high --x264-preset medium --x264-tune film"

but, the script doesn't put back the movies in each sub-folder

so, i tried --output "e:\mkv\#source_dirname#\#source_basename#.mkv" or --output "#source_dirname#\#source_basename#.mkv" or --output "e:#source_dirname#\#source_basename#.mkv" ...

but i have always an error message.

What's the correct command ?

Thanks in advance.


Georges.

AlBundy
Bright Spark User
Posts: 370
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by AlBundy » Thu Jan 30, 2014 9:48 pm

This is already the correct one

Code: Select all

hb.rb --input "e:\iso\**\*.iso" --output "e:\mkv\#source_basename#.mkv" --main --audio-copy --xtra "--quality 19.0 
--strict-anamorphic --x264-profile high --x264-preset medium --x264-tune film"
Maybe --output "e:\mkv\#source_basename#\#source_basename#.mkv" is enough for me you. If not I could add a placeholder source_parent for the directory containing the file.

Georges Orwell
Posts: 4
Joined: Thu Jan 30, 2014 9:00 am

Re: [Script] rip all episodes or only main-feature from DVD

Post by Georges Orwell » Sun Feb 02, 2014 2:02 pm

AlBundy wrote: If not I could add a placeholder source_parent for the directory containing the file.
That would be great because your solution is not really what i need. So, if you have some time...

Other question:

When i use

Code: Select all

    hb.rb --input "e:\iso\**\*.iso" --output "e:\mkv\#source_basename#.mkv" --main --audio-copy --xtra "--quality 19.0
    --strict-anamorphic --x264-profile high --x264-preset medium --x264-tune film"
This is what i have in the terminal, why do i have two differents settings ?

Code: Select all

"C:/Ruby200-x64/bin/tools/handbrake/windo
ws/HandBrakeCLI" --input "d:/test/4 FANTASTIQUES/4 FANTASTIQUES.mkv" --output "d
:/test/4 FANTASTIQUES.mkv" --encoder x264 --quality 20.0 --decomb --detelecine -
-crop 0:0:0:0 --loose-anamorphic --format mkv --markers --title 1 --audio 1,2 --
aencoder copy,copy --mixdown auto,auto --ab auto,auto --drc 0.0,0.0 --aname "Eng
lish (AC3) (5.1 ch)","Francais (AC3) (5.1 ch)" --audio-fallback lame --subtitle
1,2,3,4 --quality 19.0  --strict-anamorphic --x264-profile high --x264-preset me
dium --x264-tune film  2
Thanks for your help.

Georges

Post Reply