Blu-Ray Ripper - I NEED A CODER'S HELP! (1 Viewer)

thattexaskid19

Portal Pro
January 5, 2010
63
5
ok i have a batch file that rips Blu-ray movies to my hard drive and ANOTHER that will take the ripped data and encode it to a single outputted MKV. the first batch file dumps the movie to a movie1, movie2, movie3, etc. folder based on which folder is empty and the second batch file asks which movie to encode (movie1, movie2, etc..)

there is a big learning curve for me to learn C# and since I already have two windows batch files i was wondering if someone could port them to C# for me.

each batch file asks for an input (first one, what is the movie called, AND second, which movie to encode).


a simple version could be made of just what i have done and a more complex plugin could be made with a config asking for the following data:

-location of some exe's which do the actual decoding & encoding
-file output
-quality of audio (lossless or ac3)
-quality of video (1-10)
-drive letter of blu-ray drive
-[future] language selection?



my batch files are on the other computer ill attach them right now.

EDIT: here they are

1) rips the movie from the disc
Code:
@echo off
set PluginsFolder=D:\Downloads\MovieNeeds\
set pathToDrive=G:

IF EXIST E:\MovieRips\Movie1\Chapters.txt (IF EXIST E:\MovieRips\Movie2\Chapters.txt (IF EXIST E:\MovieRips\Movie3\Chapters.txt (IF EXIST E:\MovieRips\Movie4\Chapters.txt (SET ripdrive=Movie5) ELSE (SET ripdrive=Movie4)) ELSE (SET ripdrive=Movie3)) ELSE (SET ripdrive=Movie2)) ELSE (SET ripdrive=Movie1)

SET /P MovieTitle="--- TYPE NAME OF THE MOVIE AND PRESS ENTER --- "
If not "%MovieTitle%"=="" Set MovieTitle=%MovieTitle%

echo %MovieTitle%>>E:\MovieRips\%ripdrive%\Moviename.txt

"%PluginsFolder%eac3to\eac3to.exe" "%pathToDrive%" 1) 3: E:\MovieRips\%ripdrive%\English.flac
"%PluginsFolder%eac3to\eac3to.exe" "%pathToDrive%" 1) 1: E:\MovieRips\%ripdrive%\Chapters.txt 2: E:\MovieRips\%ripdrive%\Movie.mkv -seekToIFrames

C:\Windows\cd.vbs

2) merges the audio and video file together (and compresses video some)
Code:
@echo off
SET /P MovNo="--- WHICH MOVIE WOULD YOU LIKE TO ENCODE? --- "
If not "%MovNo%"=="" Set MovNo=%MovNo:~0,5%
echo Entered %MovNo%:

set /p MovieTitle=<E:\MovieRips\Movie%MovNo%\MovieName.txt
set PluginsFolder=D:\Downloads\MovieNeeds\

"%PluginsFolder%mencoder.exe" E:\MovieRips\Movie%MovNo%\movie.mkv -ovc x264 -x264encopts crf=18.75 -o E:\MovieRips\Movie%MovNo%\MovieCompressed.mkv

"%PluginsFolder%mkvmerge.exe" -o "E:\Movies\%MovieTitle%.mkv" -A E:\MovieRips\Movie%MovNo%\MovieCompressed.mkv E:\MovieRips\Movie%MovNo%\English.flac --chapters E:\MovieRips\Movie%MovNo%\chapters.txt

SOMEONE PLEASE HELP ME! otherwise just feel free to use my batch files for your own needs :) :D
 

jameson_uk

Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    1) rips the movie from the disc
    Code:
    ...
    "%PluginsFolder%eac3to\eac3to.exe" "%pathToDrive%" 1) 3: E:\MovieRips\%ripdrive%\English.flac
    "%PluginsFolder%eac3to\eac3to.exe" "%pathToDrive%" 1) 1: E:\MovieRips\%ripdrive%\Chapters.txt 2: E:\MovieRips\%ripdrive%\Movie.mkv -seekToIFrames
    ...
    This wont always work (and not sure why you are doing this in two passes?? you could just do
    Code:
    "%PluginsFolder%eac3to\eac3to.exe" "%pathToDrive%" 1) 3: E:\MovieRips\%ripdrive%\English.flac 1: E:\MovieRips\%ripdrive%\Chapters.txt 2: E:\MovieRips\%ripdrive%\Movie.mkv -seekToIFrames

    You are assuming that video is chapters are stream 1, main video is stream 2 and main audio is stream 3. These change on each disk and also you are pickin up playlist 1 which is not always the main or correct feature)

    Also just one more thing you need something to decode HD audio in order for this to decode DTS-HD MA or True HD to flac. I can't remember whether the ffmpeg libraries that come with eac3to are recent enough to decode TrueHD but they certainly don't decode DTS-HD MA. In fact there is no open source way of decoding HD DTS yet and getting it working through Arcsoft can be a real pain.

    Without this you will only be extracting the core DTS soundtrack and IMHO there is no point converting this to flac. Also potentially you might just be picking up an interlaced AC3 track from the TrueHD stream.

    Anyway my oiginal point is the reason this is hard to code as you need to look at the different playlists and streams and select them interactively you can not just assume stream 2 will be video etc.
     

    thattexaskid19

    Portal Pro
    January 5, 2010
    63
    5
    1) rips the movie from the disc
    Code:
    ...
    "%PluginsFolder%eac3to\eac3to.exe" "%pathToDrive%" 1) 3: E:\MovieRips\%ripdrive%\English.flac
    "%PluginsFolder%eac3to\eac3to.exe" "%pathToDrive%" 1) 1: E:\MovieRips\%ripdrive%\Chapters.txt 2: E:\MovieRips\%ripdrive%\Movie.mkv -seekToIFrames
    ...
    This wont always work (and not sure why you are doing this in two passes?? you could just do
    Code:
    "%PluginsFolder%eac3to\eac3to.exe" "%pathToDrive%" 1) 3: E:\MovieRips\%ripdrive%\English.flac 1: E:\MovieRips\%ripdrive%\Chapters.txt 2: E:\MovieRips\%ripdrive%\Movie.mkv -seekToIFrames

    You are assuming that video is chapters are stream 1, main video is stream 2 and main audio is stream 3. These change on each disk and also you are pickin up playlist 1 which is not always the main or correct feature)

    Also just one more thing you need something to decode HD audio in order for this to decode DTS-HD MA or True HD to flac. I can't remember whether the ffmpeg libraries that come with eac3to are recent enough to decode TrueHD but they certainly don't decode DTS-HD MA. In fact there is no open source way of decoding HD DTS yet and getting it working through Arcsoft can be a real pain.

    Without this you will only be extracting the core DTS soundtrack and IMHO there is no point converting this to flac. Also potentially you might just be picking up an interlaced AC3 track from the TrueHD stream.

    Anyway my oiginal point is the reason this is hard to code as you need to look at the different playlists and streams and select them interactively you can not just assume stream 2 will be video etc.


    I turned into two commands (one for audio, one for chapters/video/etc) because I kept getting corrupted FLAC files. This fixes it for me, if others don't have that problem then they can use your version just as well.

    Also, I know that it doesnt always work out to be 1,2,3 like I have coded here, it's just that usually it does. I originally had it ask you which playlist, which audio track, and which movie to select but I got sick of it.

    I regards to HD audio, I dont know a ton about the subject yet but I have TMT and madFlac both installed. With these, I'm quite confident that eac3to can decode DTS-HD and all other forms of DTS (with the help of TMT) ANDDD TrueHD as well. It seems to work very well for me at least.


    --Anyway, my point is this method works for me now, I understand what I am doing and how to fix it if the playlists/audio/video dont magically match up. My main focus right now is getting a plugin out of this if possible...
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    I regards to HD audio, I dont know a ton about the subject yet but I have TMT and madFlac both installed. With these, I'm quite confident that eac3to can decode DTS-HD and all other forms of DTS (with the help of TMT) ANDDD TrueHD as well. It seems to work very well for me at least.
    try
    Code:
    eac3to -test
    This will tell you if Arcsoft is working as far as eac3to is concerned. If it is not that you are not converting DTS HD MA to FLAC but you are converting standard DTS.

    How big are your flac files??

    Anyway, my point is this method works for me now, I understand what I am doing and how to fix it if the playlists/audio/video dont magically match up. My main focus right now is getting a plugin out of this if possible...
    But what I was saying is that in order to code this up you would need to make sure you are picking up the right audio / video / chapter streams etc. The only way to really do that is to run eac3to in the first place which then stops it frmo being a simple plugin operation
     

    thattexaskid19

    Portal Pro
    January 5, 2010
    63
    5
    yea i did the eac3to -test command a while ago and like i said it says i have TMT and madFlac installed properly. at the beginning of my command it states that it is 'decoding DTS-MA' and 'encoding FLAC'. my FLAC files vary from 1.5 to 9 GB (john mayer concert was a biggie).

    i understand that eac3to needs those number inputs and that a user needs to input them.

    First tho. I want to get what i have working -working.
    Second, I'll worry about those number inputs.
    Right now I have a config screen set up which saves the paths to all the necessary encoders/decoders/exe's/drive path.

    now i need to make buttons and labels that work with my skin.xml

    this is taking me several hours a day and its really frustrating... :mad:
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    i understand that eac3to needs those number inputs and that a user needs to input them
    But the issue is that the only way to get those numbers is to run eac3to. To do that you need to
    • close MP
    • open a command prompt#
    • run eac3to
    • scan the data
    • write it down
    • go back into MP
    • launch the plugin then do the ripping

    Basically I am just trying to point out that trying to do this as a plugin within MP might not be the best solution.
     

    joz

    Portal Pro
    March 17, 2008
    1,353
    306
    Home Country
    Netherlands Netherlands
    i understand that eac3to needs those number inputs and that a user needs to input them
    But the issue is that the only way to get those numbers is to run eac3to. To do that you need to
    • close MP
    • open a command prompt#
    • run eac3to
    • scan the data
    • write it down
    • go back into MP
    • launch the plugin then do the ripping

    Basically I am just trying to point out that trying to do this as a plugin within MP might not be the best solution.

    Don't know much about mp plugin writing but I do know that the steps you point out above can be done thru C# (and yeah the closing and opening of mp can be left out ofcourse). I can even do that with PHP which is a web language... Ofcourse it will just be able to run a command and spit out the output, or do some filtering on the output first and then spit it out in say a MP textbox or whatever, or maybe even take out the right parameters (if the output is always in the same skeleton like structure, which it's bound to be)
    So that won't hold anything back. I do not know that much about the subject though, just about the coding part :)
     

    jameson_uk

    Retired Team Member
  • Premium Supporter
  • January 27, 2005
    7,258
    2,528
    Birmingham
    Home Country
    United Kingdom United Kingdom
    Ofcourse it will just be able to run a command and spit out the output, or do some filtering on the output first and then spit it out in say a MP textbox or whatever
    This is the problem how are you going to get the output of eac3to? I am fairly sure last time I looked you it did not send the output to STDOUT so you struggle to access it programatically. (at least I think this was the problem last time I looked at automating this)
     

    Users who are viewing this thread

    Top Bottom