Copy whole DVD (rip) to hard-disk, without any encoding, just plain rip

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
Jobe77x
Posts: 7
Joined: Sat Mar 04, 2017 1:32 pm

Copy whole DVD (rip) to hard-disk, without any encoding, just plain rip

Post by Jobe77x »

Hi all!

I search this forum and only found 1 similar question, back in 2007..(no answer thou)

I'm wondering if there is anyway to make handbrake cli to simply rip a whole DVD to a hard-disk, no encoding or anything, just a plain copy, so I later can open it in "normal" handbrake and convert them?

I'm using Windows.

The reason for this is to automate the copying process so my parents just can put one of their DVD in the DVD player, and the system will rip automatically (anydvd is used in background to decode the DVD, and execute the cli command that start (hopefully handbrake) to copy the DVD, when a new DVD is inserted.

So I later can access the hard-disk and convert them with handbrake GUI for Windows..

Anybody knows if this is possible with handbrake, or do I need to find another DVD rip software (remember it must be start & controllable by dos..)
Btw, I suck in scripting..

/Jobe
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Copy whole DVD (rip) to hard-disk, without any encoding, just plain rip

Post by s55 »

HandBrake is not a ripper. It's a transcoder and it can only transocode 1 title into 1 file. So i'm afraid you can't do what you want.
Jobe77x
Posts: 7
Joined: Sat Mar 04, 2017 1:32 pm

Re: Copy whole DVD (rip) to hard-disk, without any encoding, just plain rip

Post by Jobe77x »

But handbrake can convert from the DVDs video_ts catalogue, I mean it must be faster is it copied them first to the hard-disk?..

Well, I maybe need to look for a third program to use... :?
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Copy whole DVD (rip) to hard-disk, without any encoding, just plain rip

Post by s55 »

AnyDVD can already rip an ISO/Folder, so why not just use that?
Jobe77x
Posts: 7
Joined: Sat Mar 04, 2017 1:32 pm

Re: Copy whole DVD (rip) to hard-disk, without any encoding, just plain rip

Post by Jobe77x »

Well, anydvd can start a program when I new DVD is inserted, but it's not smart enough to auto-rip the DVD, nor any functions for that..
brellyn
Posts: 14
Joined: Tue Sep 13, 2016 9:58 pm

Re: Copy whole DVD (rip) to hard-disk, without any encoding, just plain rip

Post by brellyn »

Windows itself can run programs when disks are inserted into drives, instead of depending on anydvd.

you want to run the command line version of makemkv as a batch file to rip the dvd/blue ray on insert. I have multiple blue ray drives on one machine so I had to include some code that you may not need. No guarantee this will work for you. This is what I use...

Code: Select all

echo off
set drive0=0
set drive1=0
set rawname=none
:checkdisk
cls

echo(
echo Scanning PC for drives/titles...
echo(

"c:\Program Files (x86)\MakeMKV\makemkvcon64.exe" -r info | find "DRV:0,"> c:\timer\drive0.out
for /f "useback tokens=2 delims=,"  %%a in (c:\timer\drive0.out) do if %%a NEQ 2 goto skip0

set drive0=1
for /f "useback tokens=7 delims=,"  %%a in (c:\timer\drive0.out) do (
echo Found title in DRV:0 %%a
)

:skip0

"c:\Program Files (x86)\MakeMKV\makemkvcon64.exe" -r info | find "DRV:1,"> c:\timer\drive1.out
for /f "useback tokens=2 delims=,"  %%a in (c:\timer\drive1.out) do if %%a NEQ 2 goto skip1

set drive1=1
for /f "useback tokens=7 delims=,"  %%a in (c:\timer\drive1.out) do (
echo Found title in DRV:1 %%a
)

:skip1

if %drive0% EQU 1 if %drive1% EQU 1 echo.
if %drive0% EQU 1 if %drive1% EQU 1 echo ---need to choose between drives---
if %drive0% EQU 1 if %drive1% EQU 1goto endit

if exist c:\timer\mk2.out del c:\timer\mk2.out

if %drive0% EQU 1 "c:\Program Files (x86)\MakeMKV\makemkvcon64.exe" -r info |find "DRV:0," > c:\timer\mk2.out
if %drive1% EQU 1 "c:\Program Files (x86)\MakeMKV\makemkvcon64.exe" -r info |find "DRV:1," > c:\timer\mk2.out

echo(

for /f "useback tokens=6 delims=,"  %%a in (c:\timer\mk2.out) do (
set rawname= %%~a
)

set str=%rawname%
set str=%str:_= %
set _FileName=%str%

For %%I In ("A=a" "B=b" "C=c" "D=d" "E=e" "F=f" "G=g" "H=h" "I=i" "J=j" "K=k" "L=l" "M=m" "N=n" "O=o" "P=p" "Q=q" "R=r" "S=s" "T=t" "U=u" "V=v" "W=w" "X=x" "Y=y" "Z=z" "  = ") Do Call Set "_FileName=%%_FileName:%%~I%%"

For %%I In (" a= A" " b= B" " c= C" " d= D" " e= E" " f= F" " g= G" " h= H" " i= I" " j= J" " k= K" " l= L" " m= M" " n= N" " o= O" " p= P" " q= Q" " r= R" " s= S" " t= T" " u= U" " v= V" " w= W" " x= X" " y= Y" " z= Z" "  = ") Do Call Set "_FileName=%%_FileName:%%~I%%"

set str=%_FileName%x
set str=%str:~1,-1%
set _FileName=%str%

echo(
if %drive0% EQU 1 echo [0mProceeding to rip DRV:0, title = [1;37m%_FileName%[0m...
if %drive1% EQU 1 echo [0mProceeding to rip DRV:1, title = [1;37m%_FileName%[0m...
echo(

if not exist "d:\#_staging\%_FileName%" mkdir "d:\#_staging\%_FileName%"

if %drive0% EQU 1 "c:\Program Files (x86)\MakeMKV\makemkvcon64.exe" mkv --messages=-null --progress=-stdout --minlength=5000 disc:0 all "d:\#_staging\%_FileName%"

if %drive1% EQU 1 "c:\Program Files (x86)\MakeMKV\makemkvcon64.exe" mkv --messages=-null --progress=-stdout --minlength=5000 disc:1 all "d:\#_staging\%_FileName%"

del d:\#_staging\m*.tgz /Q

dir "d:\#_staging\%_FileName%" /B /ON |find /I ".mkv" > c:\timer\mk2.out

for /f "tokens=*" %%l in (c:\timer\mk2.out) do (
set fmfolder=%%l
)

cls

@echo(

if exist "c:\timer\drive1.out" del "c:\timer\drive1.out" /Q
if exist "c:\timer\drive0.out" del "c:\timer\drive0.out" /Q
if exist "c:\timer\mk2.out" del "c:\timer\mk2.out" /Q

if not exist "d:\#_staging\%_FileName%\%_FileName%.mkv" (
	rename "d:\#_staging\%_FileName%\%fmfolder%" "%_FileName%.mkv"
)

echo ejecting tray...

if %drive0% EQU 1 powershell (New-Object -com "WMPlayer.OCX.7").cdromcollection.item(0).eject()
if %drive1% EQU 1 powershell (New-Object -com "WMPlayer.OCX.7").cdromcollection.item(1).eject()

:endit

cls
echo(
echo [0mProcessing complete for [1;37m%_Filename%[0m.
echo(

Jobe77x
Posts: 7
Joined: Sat Mar 04, 2017 1:32 pm

Re: Copy whole DVD (rip) to hard-disk, without any encoding, just plain rip

Post by Jobe77x »

I have never tried makemkv, I'm skeptic to . mkv (don't know why).
But I could always take a look at it, thx
brellyn
Posts: 14
Joined: Tue Sep 13, 2016 9:58 pm

Re: Copy whole DVD (rip) to hard-disk, without any encoding, just plain rip

Post by brellyn »

My entire library is .MKV because it works so well with Kodi. 1200+ movies and not one issue.
Jobe77x
Posts: 7
Joined: Sat Mar 04, 2017 1:32 pm

Re: Copy whole DVD (rip) to hard-disk, without any encoding, just plain rip

Post by Jobe77x »

Ok, I'm running Emby and Plex, I'm sure they can handle mkv too, but, well, maybe it's an old habit of using .mp4, but it's definitely worth taking s look at it..
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Copy whole DVD (rip) to hard-disk, without any encoding, just plain rip

Post by Woodstock »

If your devices support MKV, you should drop MP4. MP4 has limited support for subtitles and audio, that aren't there with MKV.

However, some devices that support MKV do so poorly - my older Android tablet cannot maintain audio sync with MKV files, so I encode separate MP4 files for it, to match its limitation, and "full feature" MKV files for the devices that support them.
Last edited by Woodstock on Sun Mar 26, 2017 1:23 am, edited 1 time in total.
Jobe77x
Posts: 7
Joined: Sat Mar 04, 2017 1:32 pm

Re: Copy whole DVD (rip) to hard-disk, without any encoding, just plain rip

Post by Jobe77x »

I'll check the server software, since it's them that are transcoding the media during streaming, thx for the input..
brellyn
Posts: 14
Joined: Tue Sep 13, 2016 9:58 pm

Re: Copy whole DVD (rip) to hard-disk, without any encoding, just plain rip

Post by brellyn »

Once the DVD is ripped with MAKEMKV, encode it with HandbrakeCLI as an mp4. You can add this code to the end of the previous Makemkv batch file

Code: Select all

@echo off

set mname=d
set folder=d
set rawname=d
set quotes=0

cls
if [%7]==[] set folder=%1 %2 %3 %4 %5 %6
if [%6]==[] set folder=%1 %2 %3 %4 %5
if [%5]==[] set folder=%1 %2 %3 %4
if [%4]==[] set folder=%1 %2 %3
if [%3]==[] set folder=%1 %2
if [%2]==[] set folder=%1

echo.[0m

echo.%folder% | find /I "mkv" >NUL
if errorlevel 1 (
set mname=%folder%.mkv
set rawname=%folder%.mkv
) else (
set mname=%folder%
set quotes=1
)

if %quotes% EQU 1 for /f "useback tokens=*" %%a in ('%mname%') do set rawname=%%~a

if %quotes% EQU 1 set folder=%rawname:~0,-4%

rem echo %quotes% %mname% %rawname% %folder%

if exist "%rawname%" echo found [1;37m%mname%[0m
if exist "%rawname%" rename "%rawname%" "%folder%.old"
if exist "%folder%.old" goto continue1

echo(

echo Did not find a movie called %mname%

goto End

:continue1

echo(
echo Processing file...[1;37m
echo(

"c:\program files\handbrakeCLI\handbrakecli.exe" -i "%folder%.old" -o "%rawname%" -s 1,2,3,4 -Z Normal -non-anamorphic -f mkv 2>"d:\#_staging\%folder%\%folder%.err"

echo(

@echo [0mProcessing complete for [1;37m%folder%[0m

cd ..
:End
echo(

[/ccode]
Post Reply