Kodi Community Forum
Win One Button DVD/BluRay Ripping using a Launcher from within XBMC - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Tips, tricks, and step by step guides (https://forum.kodi.tv/forumdisplay.php?fid=110)
+--- Thread: Win One Button DVD/BluRay Ripping using a Launcher from within XBMC (/showthread.php?tid=105168)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - Spinalcrack - 2012-08-09

(2012-08-09, 20:08)wints Wrote: ok a couple of things why does AutoRipDVD eject the disk after ripping but then tell you that theres no disc in the drive please insert the disk? and second just noticed that when i watch the rip in XBMC the sound is flagged as 1.0? any ideas what im doing wrong? cheers

It should eject the disk after the rip. It should only ever tell you to insert a disc if you run AutoRipDVD with no disc in the drive or with the drive door open. Basically it checks if there is a disc in the specified drive, that you would have set in AutoRipDVD.bat. If it can read the media it does it's thing, and if it can't it tells you that warning that there is no disc and to insert one.

The sound being 1.0 is because handbrake is set to downmix the audio to mono when using surround sound, to keep the compression as small as possible. You can change this in AutoRipDVD.bat with this line:

Code:
Set QUALITY=--ab 64 --mixdown mono --quality 23 -e x264 -x %X264%

Change where it says mono to any of the following: mono/stereo/dpl1/dpl2/6ch

So for stereo it would read:

Code:
Set QUALITY=--ab 64 --mixdown stereo --quality 23 -e x264 -x %X264%

but the file size will be larger obviously.

This is the problem with adding compression to AutoRipDVD. Everyone will want different options on the compression.

Please see here for all options available for handbrake




RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - wints - 2012-08-10

(2012-08-09, 20:19)Spinalcrack Wrote:
(2012-08-09, 20:08)wints Wrote: ok a couple of things why does AutoRipDVD eject the disk after ripping but then tell you that theres no disc in the drive please insert the disk? and second just noticed that when i watch the rip in XBMC the sound is flagged as 1.0? any ideas what im doing wrong? cheers

It should eject the disk after the rip. It should only ever tell you to insert a disc if you run AutoRipDVD with no disc in the drive or with the drive door open. Basically it checks if there is a disc in the specified drive, that you would have set in AutoRipDVD.bat. If it can read the media it does it's thing, and if it can't it tells you that warning that there is no disc and to insert one.

The sound being 1.0 is because handbrake is set to downmix the audio to mono when using surround sound, to keep the compression as small as possible. You can change this in AutoRipDVD.bat with this line:

Code:
Set QUALITY=--ab 64 --mixdown mono --quality 23 -e x264 -x %X264%

Change where it says mono to any of the following: mono/stereo/dpl1/dpl2/6ch

So for stereo it would read:

Code:
Set QUALITY=--ab 64 --mixdown stereo --quality 23 -e x264 -x %X264%

but the file size will be larger obviously.

This is the problem with adding compression to AutoRipDVD. Everyone will want different options on the compression.

Please see here for all options available for handbrake

Cheers for the help mate thats great, regards the insert disk just cant understand why when it has ripped the disk successfully and the draw opens why i still get the message about no disk in the drive weird lol cheers though


RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - Spinalcrack - 2012-08-10

(2012-08-10, 13:08)wints Wrote: Cheers for the help mate thats great, regards the insert disk just cant understand why when it has ripped the disk successfully and the draw opens why i still get the message about no disk in the drive weird lol cheers though

If you want to post your AutoRipDVD.bat file here I'll take a look and try to help


RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - wints - 2012-08-10

Many thanks for taking the time mate very much appreciated Smile


Code:
@Echo offSetlocal enableextensions
::*********************************************************************************************
::*** AutoRipDVD is brought to you by Spinalcracker
::*********************************************************************************************
::
::*********************************************************************************************
::***  Change the following variables to match your setup
::*********************************************************************************************
::
::*** DriveLetter=The drive letter of your DVD or Blu-Ray drive ie. D: or G: etc
::
::------------------------------
Set DriveLetter=D:
::------------------------------
::
::*** RipDir=Where you want your DVD ripped to ie. your xbmc movie folder *BE SURE TO INCLUDE TRAILING \
::
::------------------------------
Set RipDir=E:\Movies\
::------------------------------
::
::*** IntDir=Where you installed MakeMKV to
::
::----------------------------------------
Set IntDir=C:\Program Files (x86)\MakeMKV
::----------------------------------------
::
::*** ScriptPath=Where the files for this script are located with trailing "\" ie. Where AutoRipComplete.vbs & Beep.vbs are located *BE SURE TO INCLUDE TRAILING \
::
::------------------------------------
Set ScriptPath=C:\Program Files (x86)\AutoRipDVD\
::------------------------------------
::
::*** RipMinSeconds=Minimum time in seconds that should be ripped off disk to avoid getting previews etc.  Default is 3600 seconds or 1 hour
::
::---------------------
Set RipMinSeconds=3600
::---------------------
::
::*** Using Handbrake to compress - Yes or No?
::
::------------------------------------
Set Handbrake=Yes
::------------------------------------
::
::*** Sets the install path to handbrake
::
::------------------------------------
Set Handbrakepath=C:\Program Files (x86)\HandBrake CLI\
::------------------------------------
::
::*** Sets the level of compression in Handbrake so unless you really know what you are doing, do NOT adjust this next setting!
::
::------------------------------------
Set X264=b-adapt=2:rc-lookahead=50:me=umh:bframes=5:ref=6:direct=auto:trellis=2:subq=10:psy-rd=1.0,0.10:analyse=all
::------------------------------------
::
::*** Sets the format of the new compressed file, so again, unless you know what you are doing, please leave it as mkv!
::
::------------------------------------
Set FORMAT=--optimize --format mkv
::------------------------------------
::
::*** Sets the quality to something visually appealing but in a small files size - play with this if your outcome isn't to your liking
::
::------------------------------------
Set QUALITY=----preset=./HandBrakeCLI -i DVD -o ~/Movies/movie.mp4  -e x264 -q 20.0 -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 -f mp4 --strict-anamorphic -m -x ref=2:bframes=2:subme=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0

--------------------------------------------------------------------------------

::------------------------------------
::
::*** Sets the output to 720p resolution - change if you prefer something else
::
::------------------------------------
Set SIZE=--width 1280 --height 720
::------------------------------------
::
::*********************************************************************************************
::*********************************************************************************************
::******* DO NOT EDIT ANYTHING BELOW THIS!!!!!!************************************************
::*********************************************************************************************
::*********************************************************************************************



::For /f %%# In ('Mountvol^|Findstr [d-z]:\\') Do (
::        Fsutil fsinfo drivetype %%#|Find "CD-ROM">Nul&&(Set "CDROM=%%~d#"))
::If Not Defined CDROM call :NoDrive


for /f "tokens=1-5*" %%1 in ('vol %DriveLetter%') do (
    set volid=%%6 & goto processcontd
)

:processcontd
set nospace=%volid%
echo [%nospace%]
echo.
for /f "tokens=* delims= " %%A in ('echo %nospace% ') do set nospace=%%A
set nospace=%nospace:~0,-1%
echo [%nospace%]
set volid=%nospace%
echo: %volid%

set str=%volid%
echo.%str%
set str=%str:_= %
echo.%str%
set volid=%str%
If "%volid%"=="_= " call :NoDrive

Echo:Ripping %volid% now...

mkdir "%RipDir%%volid%"

cd /d "%ScriptPath%"
OSDAutoRip.hta

cd /d "%IntDir%"
makemkvcon64.exe --minlength=%RipMinSeconds% mkv disc:0 all "%RipDir%%volid%"

SET _tmpPath="%RipDir%%volid%"
cd /d %_tmpPath%
for %%i in ("title*.mkv") do (set fname=%%i) & call :rename

If %Handbrake%==Yes call :HBEncode

cd /d "%ScriptPath%"
AutoRipComplete.vbs
cscript Beep.vbs
exit

:NoDrive
cd /d "%ScriptPath%"
cscript Beep.vbs
NoDiskDrive.hta
AutoRipComplete.vbs
exit

:HBEncode
cd /d "%Handbrakepath%"
HandBrakeCLI -v0 -i "%RipDir%%volid%" -o "%RipDir%%volid%\%volid% 720p.mkv" %FORMAT% %QUALITY% %SIZE%
cd /d %_tmpPath%
del "%volid%_*.mkv"

:rename
::Cuts off 1st 5 characters of fname, then appends prefix
ren %fname% "%volid%"_%fname:~5%



RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - Spinalcrack - 2012-08-10

@wints

Code:
Set QUALITY=----preset=./HandBrakeCLI -i DVD -o ~/Movies/movie.mp4  -e x264 -q 20.0 -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 -f mp4 --strict-anamorphic -m -x ref=2:bframes=2:subme=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0

--------------------------------------------------------------------------------

This line is butchered a bit. Couple things. You are doing the entire command line in the variable "QUALITY" which gets duplicated with other variables. If you look further down in the AutoRipDVD.bat file you will see this line (which is actually the handbrake command line call)

Code:
HandBrakeCLI -v0 -i "%RipDir%%volid%" -o "%RipDir%%volid%\%volid% 720p.mkv" %FORMAT% %QUALITY% %SIZE%

So, you can see you are duplicating the -i, the -o, the format, all in the Quality portion. The handbrake command you are actually passing to windows looks like this

Code:
HandBrakeCLI -v0 -i "E:\Movies\Volume_Name_of_Movie" -o "E:\Movies\Volume_Name_of_Movie 720p.mkv" --optimize --format mkv ----preset=./HandBrakeCLI -i DVD -o ~/Movies/movie.mp4  -e x264 -q 20.0 -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0.0 -f mp4 --strict-anamorphic -m -x ref=2:bframes=2:subme=6:mixed-refs=0:weightb=0:8x8dct=0:trellis=0 --width 1280 --height 720

Which you can tell from the handbrake options link I posted earlier is a bit of a mess. You didn't even include the %X264% variable, so all that is gone.

Also you removed the "::" from the dash separator line so it is looking like

Code:
--------------------------------------------------------------------------------

Which means it's trying to now execute that line that windows can't recognize.

So you have a lot of errors in your .bat file. I recommend deleting and re-downloading a new AutoRipDVD.bat file and on this line

Code:
Set QUALITY=--ab 64 --mixdown mono --quality 23 -e x264 -x %X264%

Only change the options after the dashes. DO NOT remove %X264%. Instead change the options on the X264 line. You still have it in your .bat now but it's not even being used.

Code:
::------------------------------------
Set X264=b-adapt=2:rc-lookahead=50:me=umh:bframes=5:ref=6:direct=auto:trellis=2:subq=10:psy-rd=1.0,0.10:analyse=all
::------------------------------------

Hopefully this makes sense. You are probably getting all kinds of hidden errors and it's freaking out and giving the no disc warning.



RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - wints - 2012-08-10

ok thanks again i'll try again with a fresh .bat file


RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - kaffekask - 2012-08-10

I think this
Code:
:HBEncode
cd /d "%Handbrakepath%"
HandBrakeCLI -v0 -i "%RipDir%%volid%" -o "%RipDir%%volid%\%volid% 720p.mkv" %FORMAT% %QUALITY% %SIZE%
cd /d %_tmpPath%
del "%volid%_*.mkv"

:rename
::Cuts off 1st 5 characters of fname, then appends prefix
ren %fname% "%volid%"_%fname:~5%

should be like this
Code:
:HBEncode
cd /d "%Handbrakepath%"
HandBrakeCLI -v0 -i "%RipDir%%volid%" -o "%RipDir%%volid%\%volid% 720p.mkv" %FORMAT% %QUALITY% %SIZE%
cd /d %_tmpPath%
del "%volid%_*.mkv"
exit

:rename
::Cuts off 1st 5 characters of fname, then appends prefix
ren %fname% "%volid%"_%fname:~5%

otherwise it tries to rename the file after Handbrake is done, which would result in an error message.

Edit: And I would add an exit after rename also just in case if something is added after it in the future.


RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - Spinalcrack - 2012-08-10

(2012-08-10, 20:23)kaffekask Wrote: I think this
Code:
:HBEncode
cd /d "%Handbrakepath%"
HandBrakeCLI -v0 -i "%RipDir%%volid%" -o "%RipDir%%volid%\%volid% 720p.mkv" %FORMAT% %QUALITY% %SIZE%
cd /d %_tmpPath%
del "%volid%_*.mkv"

:rename
::Cuts off 1st 5 characters of fname, then appends prefix
ren %fname% "%volid%"_%fname:~5%

should be like this
Code:
:HBEncode
cd /d "%Handbrakepath%"
HandBrakeCLI -v0 -i "%RipDir%%volid%" -o "%RipDir%%volid%\%volid% 720p.mkv" %FORMAT% %QUALITY% %SIZE%
cd /d %_tmpPath%
del "%volid%_*.mkv"
exit

:rename
::Cuts off 1st 5 characters of fname, then appends prefix
ren %fname% "%volid%"_%fname:~5%

otherwise it tries to rename the file after Handbrake is done, which would result in an error message.

Edit: And I would add an exit after rename also just in case if something is added after it in the future.

Adding the exit to the encode section definitely won't hurt anything. The reason it shouldn't matter though is the rename sub is called before it ever gets to the encoding so when it tries to rename it a second time the file no longer exits, so windows just says it's not there and moves on without hurting anything.

It's definitely cleaner to have that exit. I actually noticed that when I did the last bug fix and changed the goto:eof to an exit for a similar reason, but the way it is now shouldn't cause a problem. As soon as I get some time, I'll add that in to the encode sub and rename sub.

Edit: I'm on crack today and said something ridiculous just now that I edited back out, lol... don't mind me Smile


RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - hewskie - 2012-08-14

Hi SpinalCrack,

Thanks for the awesome scripts. I was able to set up everything perfectly including handbrake, however i just have 1 question. When the compression was done, i was left with 2 files in the movie folder, the original uncompressed and the new compressed. I thought it was supposed to delete the original file once done? I'm running Win7, do you need to see a copy of any of the scripts? I left all default settings basically.

Cheers,

Hewskie

Edit: Just finished my 2nd rip, didn't happen this time. Looks like it worked as expected. Not sure what happened with the first try, any ideas?

Cheers


RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - Spinalcrack - 2012-08-15

(2012-08-14, 22:07)hewskie Wrote: Edit: Just finished my 2nd rip, didn't happen this time. Looks like it worked as expected. Not sure what happened with the first try, any ideas?

Cheers

Not sure off the top, but keep an eye on it and if it happens again, or you notice a pattern (ie. never deletes titles with the word "The" or something weird) let me know and I'll try to help if possible.


RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - hewskie - 2012-08-16

Ok, it happened again, to the movie "AI" this time, but I'm not too worried about it.

New problem:

I've ripped about 6 or 7 movies now and they all have subtitles attached and defaulted to ON if I don't compress them with handbrake. If I do use handbrake, it gets rid of the subtitles completely. I have quite a bit of space and the compression takes a long time. I have somewhere between 400 - 500 dvds to rip so i thought for now I'd just leave them uncompressed. If i open them in VLC and right click the video, I can turn the subtitles off, but I can't seem to find any settings in XBMC that will default to subtitles off.

I know you said the makemkv program just rips any stream longer than 1 hour, but do you have any idea why it is also is taking the subtitles every time?

Thanks


RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - Spinalcrack - 2012-08-16

(2012-08-16, 19:22)hewskie Wrote: Ok, it happened again, to the movie "AI" this time, but I'm not too worried about it.

New problem:

I've ripped about 6 or 7 movies now and they all have subtitles attached and defaulted to ON if I don't compress them with handbrake. If I do use handbrake, it gets rid of the subtitles completely. I have quite a bit of space and the compression takes a long time. I have somewhere between 400 - 500 dvds to rip so i thought for now I'd just leave them uncompressed. If i open them in VLC and right click the video, I can turn the subtitles off, but I can't seem to find any settings in XBMC that will default to subtitles off.

I know you said the makemkv program just rips any stream longer than 1 hour, but do you have any idea why it is also is taking the subtitles every time?

Thanks

Ya makemkv rips the subtitles to, but as you said you can turn them off. To have them default to off in XBMC do this. Start playing any video, and take the mouse pointer to the bottom of the screen. The play/Stop etc controls will come up. On the right hand side there is an Audio icon. Click that. Go down to where it says Enable Subtitles and there is a radio button that is on. Unselect that to disable subtitle and then go further down and select set as default for all movies.

You can still turn them back on for individual movies / shows, but it will now default to having the subtitles off. You kinda want subtitles anyways because in some movies that are say in English, there will be Spanish or Japanese parts etc that you will want just that snippet for.

If you want to keep the subtitles in the compressed file you need to add the subtitle option in your AutoRipDVD.bat file. The two main options are

Quote: -N, --native-language Specifiy your language preference. When the first
<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 cetera)
--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.

So you would need to change this line:

Code:
Set QUALITY=--ab 64 --mixdown mono --quality 23 -e x264 -x %X264%

to

Code:
Set QUALITY=--ab 64 --N eng --mixdown mono --quality 23 -e x264 -x %X264%

or something other than "eng" if you want the subs in another language. There are a lot of options for Handbrake, especially with the sound and subtitles. You can add the options to the QUALITY like in AutoRipDVD.bat. All options can be found here: https://trac.handbrake.fr/wiki/CLIGuide


I still do not understand why you are getting two files when compressing though. What seems weird is that it's not doing that every time or is it?


RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - hewskie - 2012-08-17

Thanks for the reply, I found the subtitles option in XBMC earlier today through a google search but thanks anyway!

definitely weird about not always deleting the original when using compression. It's happened twice now on 2 different setups. (my desktop and my htpc)

at any rate, I've decided that the compression takes way too long and i can live without it for now so it shouldn't be an issue for me.

Thanks again for your help!

Cheers


New forum member is here - Geatteevold - 2012-08-23

Hey all!

I just registered and like to say hello to this great forum!


RE: One Button DVD/BluRay Ripping using a Launcher from within XBMC - tim619 - 2012-08-23

@Spinalcrack

thx for your work on this, but since years I (and many others) am looking for a way to not rip but just copy a dvd to iso or folder in xbmc, because its much more quick and requires not as much
hardware. could you pls make a script for copying a dvd using dvddecrypter? although i couldnt find on google it should has parameters to run automated with custom options like copy without menu or extras (ripit4me uses parameters on dvddecrypter).

thanks


e: all parameters are in the readme.txt after setup install