Announcement

Collapse
No announcement yet.

Batch Ripping from ISO to MP4 - settings issues

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    DVD Ripper Batch Ripping from ISO to MP4 - settings issues

    I have all of my DVDs ripped to ISO's which I use on my machine and a network media player or two. I have a script to generate the ISO's and it works wonderfully. I love having the ISO's as it gives me the whole DVD experience... however, for my tablet and other mobile devices, I want to have smaller / nimbler files.

    Enter MP4 and a batch file I've cobbled together... I've found though that the CLI mode does things slightly differently than the GUI. It is as if it is ignoring some settings in the GUI.

    Example, no matter what my settings are, I can't get the thing to create a file name in the format I want (which is to use whatever the iso file name is and an mp4 extension). I also can't seem to get it to save all of the mp4 files in one directory, it wants to create subdirectories.

    So, is it my command line, or is it the product... here is my batch...

    Code:
    @echo off
    
    ::Output what is going on...
    echo.Initializing...
    
    ::enable delayed variable expansion (to counter stupid dos batch behaviour) 
    echo.- EnableDelayedExpansion
    SETLOCAL EnableDelayedExpansion
    set pathback=%cd%
    
    ::output variables
    echo.- setting variables
    set exe=I:\Apps\DVDFab\DVDFab.exe
    set isodrive=G:
    set isodir=G:\dvds\isos
    set isoext=iso
    set mp4drive=F:
    set mp4dir=F:\mp4s\
    set mp4ext=mp4
    set scriptdrive=G:
    
    echo.-- isodrive=%isodrive%
    echo.-- isodir=%isodir%
    echo.-- isoext=%isoext%
    echo.-- mp4drive=%mp4drive%
    echo.-- mp4dir=%mp4dir%
    echo.-- mp4ext=%mp4ext%
    
    %isodrive%
    cd %isodir%
    for /f "delims=" %%X in ('dir /b /o-n *.%%isoext%%') do (
    IF not exist "%mp4dir%\%%~nX.%mp4ext%" (
      echo.!date! !time! Processing %%~sX
      %exe% /MODE "DVDMP4" /PROFILE "cellphone.GalaxyTab.mp4" /SRC "%%~sX" /DEST "%mp4dir%\%%~nX.%mp4ext%" /CLOSE
    ) ELSE (
      echo.!date! !time! Skipping   %%~sX ...%mp4dir%\%%~nX.%mp4ext% already exists.
    )
    )
    
    %scriptdrive%
    cd %pathback%
    
    @echo on
    what I want on the output side is f:\mp4s to have one mp4 file for each of the iso's found in g:\dvds\isos\.

    what I get with this on the output side is something like this...

    f:\mp4s (dir)
    f:\mp4s\animal_house.mp4 (dir)
    f:\mp4s\animal_house.mp4\mp4 (dir)
    f:\mp4s\animal_house.mp4\mp4\animal_house (dir)
    f:\mp4s\animal_house.mp4\mp4\animal_house\animal_h ouse.Title1.mp4 (file)

    now, I could write another script to clean this up, but it seems like that is avoiding the real issue.

    can anyone lend me a hand? again, i can't tell if my command line is botched or the product isn't paying attention to the settings right.

    thanks
    bruce

    #2
    Hi,

    Currently the best you can do for the output directory is:
    F:\mp4\animal_house\animal_h ouse.Title1.mp4

    Change:
    set mp4dir=F:\mp4s\ to just F:
    /DEST "%mp4dir%\%%~nX.%mp4ext%" to /DEST "%mp4dir%\"

    I see that DVDFAB is automatically creating \MP4\DVD_VOLUME_NAME\DVD_Volume_name.titleNUMBER.m p4

    I am currently ripping disks.
    I will post back after I test some ideas out.

    Thanks,
    Kevin

    Comment


      #3
      Hi,

      This should do what you want.
      This code is in testrun mode.
      Remove "rem" on from this line "rem (set testruncmd=)". For it to process the commands.
      Here is the code:
      Code:
      @echo off
      
      ::Output what is going on...
      echo.Initializing...
      
      ::enable delayed variable expansion (to counter stupid dos batch behaviour) 
      echo.- EnableDelayedExpansion
      SETLOCAL EnableDelayedExpansion
      set pathback=%cd%
      
      ::output variables
      echo.- setting variables
      set exe=I:\Apps\DVDFab\DVDFab.exe
      
      set isodrive=G:
      set isopath=\dvds\isos\
      set isodir=%isodrive%%isopath%
      set isoext=iso
      set mp4drive=F:
      set mp4path=\mp4s\
      set mp4dir=%mp4drive%%mp4path%
      set mp4ext=mp4
      
      rem test run cmd will echo commands
      set testruncmd=echo Test CMD:
      rem (set testruncmd=)
      rem Yes to run DVDFab when output directory exists
      set overwriteoutput=yes
      echo Over write output files: %overwriteoutput%
      rem Yes will exit. No will process moveoutput files and directory cleanup
      set exitifdirectoryexists=yes
      echo Exit if output directory is there already: %exitifdirectoryexists%
      rem move output files
      set moveoutputfiles=yes
      echo Will I be moving output files: %moveoutputfiles%
      rem move output files to mp4dir
      set movefilestomp4dir=yes
      echo Will move output files to %mp4dir%: %movefilestomp4dir%
      rem remove output directory levels
      set cleanupdirectory=yes
      echo Remove extra output directory levels: %cleanupdirectory%
      
      set ripprovile=cellphone.GalaxyTab.mp4
      
      echo.-- isodrive=%isodrive%
      echo.-- isodir=%isodir%
      echo.-- isoext=%isoext%
      echo.-- mp4drive=%mp4drive%
      echo.-- mp4dir=%mp4dir%
      echo.-- mp4ext=%mp4ext%
      echo --- ---
      
      for /f "delims=" %%X in ('dir /B /S /O:-N "%isodir%*.%isoext%"') do (
      echo ISO File drive: %%~dX
      echo ISO File path: %%~pX
      echo ISO File name: %%~nX
      echo ISO File Ext: %%~xX
      echo --- ---
      IF [%overwriteoutput%] EQU [yes] (
        echo.!date! !time! Processing "%%~nxX" Overwrite: %overwriteoutput%
        %testruncmd% %exe% /MODE "DVDMP4" /PROFILE "%ripprofile%" /SRC "%%~dpnxX" /DEST "%mp4dir%%%~nX" /CLOSE
      ) ELSE (
      IF not exist "%mp4dir%%%~nX\%mp4ext%\" (
        echo.!date! !time! Processing "%%~nxX" Overwrite: %overwriteoutput%
        %testruncmd% %exe% /MODE "DVDMP4" /PROFILE "%ripprofile%" /SRC "%%~dpnxX" /DEST "%mp4dir%%%~nX" /CLOSE
      ) ELSE (
        echo.!date! !time! Skipping  Input: %%~dpnxX ... Output: "%mp4dir%%%~nX\%mp4ext%\" already exists.
        if %exitifdirectoryexists% EQU yes goto :eof
      rem IF not exist "%mp4dir%%%~nX" (
      )
      rem IF [%overwrite%] EQU [yes] (
      )
      echo.!date! !time! DVDFAB Processing of "%%~nxX" Complete
      echo --- ---
      set movetodirectory=%mp4dir%%%~nX\
      if [%movefilestomp4dir%] EQU [yes] set movetodirectory=%mp4dir%
      IF [%moveoutputfiles%] EQU [yes] (
      for /f "delims=" %%M in ('dir /B /S /O:-n "%mp4dir%%%~nX"') do (
      set movefiledrive=%%~dM
      set movefilepath=%%~pM
      set movefilename=%%~nM
      set movefileext=%%~xM
      echo Move File drive: !movefiledrive!
      echo Move File path: !movefilepath!
      echo Move File name: !movefilename!
      echo Move File Ext: !movefileext!
      if [!movefileext!] NEQ [] (
      echo on
      echo Moving: "!movefiledrive!!movefilepath!!movefilename!!movefileext!" to "!movetodirectory!"
      if ["%testruncmd%"] GTR [""]  %testruncmd% move /Y  "!movefiledrive!!movefilepath!!movefilename!!movefileext!" "!movetodirectory!"
      %testruncmd% move /Y  "!movefiledrive!!movefilepath!!movefilename!!movefileext!" "!movetodirectory!" >NUL
      echo off
      echo Move File Status: Moved
      ) ELSE (
      echo Move File Status: Skipped
      rem if [!movefileext!] NEQ [] (
      )
      echo --- ---
      rem for /f "delims=" %%M in ('dir /B /S /O:-N "%mp4dir%%%~nX"') do (
      )
      rem IF [%moveoutputfiles%] EQU [yes] (
      )
      IF [%cleanupdirectory%] EQU [yes] (
      set outputvolnameinlist=no
      set /A removedirlistcnt=0
      for /f "delims=" %%R in ('dir /B /S /O:-N "%mp4dir%%%~nX\*."') do (
      set removedirdrive=%%~dR
      set removedirpath=%%~pR
      set removedirname=%%~nR
      set removedirext=%%~xR
      set removedir=!removedirdrive!!removedirpath!!removedirname!
      set removedirchk=!removedir!
      call :locase removedirchk
      set keepthisdir=%mp4dir%%%~nX\
      call :locase keepthisdir
      if [%movefilestomp4dir%] EQU [yes] (
      if [!outputvolnameinlist!] NEQ [yes] (
      set /A removedirlistcnt=removedirlistcnt+1
      set rmdirlist!removedirlistcnt!=%mp4dir%%%~nX
      set outputvolnameinlist=yes
      rem if [!outputvolnameinlist!] NEQ [yes] (
      )
      rem if [%movefilestomp4dir%] EQU [yes] (
      )
      if "!removedirchk!" NEQ "!keepthisdir!" (
      set /A removedirlistcnt=removedirlistcnt+1
      set rmdirlist!removedirlistcnt!=!removedirchk!
      rem if "!removedirchk!" NEQ "!keepthisdir!" (
      )
      rem for /f "delims=" %%R in ('dir /B /S /O:-N "!movetodirectory!*."') do (
      )
      
      for /L %%D in (!removedirlistcnt!,-1,1) do (
      if defined rmdirlist%%D  (
      if exist "!rmdirlist%%D!" (
      echo Remove directory: "!rmdirlist%%D!"
      if exist "!rmdirlist%%D!\Thumbs.db" del /A:S "!rmdirlist%%D!\Thumbs.db"
      %testruncmd% rmdir /Q "!rmdirlist%%D!"
      timeout /T 3
      echo --- ---
      rem if exist "!rmdirlist%%D!" (
      )
      rem if defined rmdirlist%%D (
      )
      rem for /L %%D in (!removedirlistcnt!,-1,1) do (
      )
      rem  IF [%cleanupdirectory%] EQU [yes] (
      )
      rem for /f "delims=" %%X in ('dir /B /S /O:-N "%isodir%*.%isoext%"') do (
      )
      
      ENDLOCAL EnableDelayedExpansion
      :: skip Subroutine and end batch file
      goto :eof
      
      ::  Subroutine
      :LoCase
      :: Subroutine to convert a variable VALUE to all lower case.
      :: The argument for this subroutine is the variable NAME.
      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 "%1=%%%1:%%~i%%"
      exit /B
      Thanks,
      Kevin

      Comment

      Working...
      X