[Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)
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.
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.
Re: [Script] rip all episodes or only main-feature from DVD
AlBundy, I tested the new log and the only first track option and everything works fine.
Communicating directly with the programmer really make thing happened.
Thanks again for your help and patience. Time for me to do batch conversion
Communicating directly with the programmer really make thing happened.
Thanks again for your help and patience. Time for me to do batch conversion
Re: [Script] rip all episodes or only main-feature from DVD
You're welcome.
Al
Al
Re: [Script] rip all episodes or only main-feature from DVD
I've uploaded a new version which supports --eject argument (to eject disc after conversion).
Also the required time will be displayed on end of each input.
The --eject argument works only on OSX and Linux.
--> --eject is only displayed in help if command is available.
Also the required time will be displayed on end of each input.
The --eject argument works only on OSX and Linux.
--> --eject is only displayed in help if command is available.
Re: [Script] rip all episodes or only main-feature from DVD
AlBundy,
What is an example of "recursive converting?" I would like to apply your script for distributed rendering on network of computers.
Thanks.
What is an example of "recursive converting?" I would like to apply your script for distributed rendering on network of computers.
Thanks.
Re: [Script] rip all episodes or only main-feature from DVD
From help:
Or
Al
Code: Select all
convert all local DVDs recursive in a directory
hb.rb --input "~/DVD/**/VIDEO_TS" --output "~/#title#_#pos#.m4v"
Code: Select all
hb.rb --input "~/DVD/**/*.mkv" --output "~/#title#.m4v"
-
- Posts: 5
- Joined: Tue May 28, 2013 10:30 pm
Re: [Script] rip all episodes or only main-feature from DVD
First of all, I want to thank you for making such an awesome script...THANK YOU! Saved me so much time encoding all file types per directory.
My issue is this: I am converting MKV files (sometimes AVI or FLV), and I am having one issue when using the AppleTV 3 preset you have designated. When using the "--verbose" command, I notice that there are instances in the injected code for each file that essentially requests the file to encode audio tracks into AC3 files (ffac3). Here's an example: "AC3 Passthru requested and input codec is not AC3 for track 2, using AC3 encoder
AC3 Passthru requested and input codec is not AC3 for track 4, using AC3 encoder"
Basically, all of my files have one or more language audio tracks (almost always more than one) and almost all of them (though sometimes none) have subtitles.
My only issue is that when I use the --preset AppleTV 3 command to ensure what I am encoding works with iTunes, I get an extra track for every AAC track that is AC-3. In some instances when the original track was AC-3 6channel I definitely want those original 6-channel AC3 tracks to stay in the M4V file. For anything more than 2 channels, I want it converted to an AC-3 equivalent. However, since I am batch encoding hundreds of files (tv show series and movies), I am forced to open all these files using Subler and individually remove the AC3-2channel tracks, while being careful keep any AC-3 6-Channel tracks.
I realize that the best way for me to state what I am trying to accomplish is this: Convert all audio tracks to AAC (AppleTV3 preset). If the original is AAC 6-channel, then (unless I am mistaken for iTunes and AppleTV compatibility), I want to retain the AAC 6-Channel while having an extra AAC 2-channel track mixdown to work with Apple TV 3. I want the same to be true for any AC-3 6 channel audio tracks. I never want an AC-3 2-channel track since I will always have/need the AAC 2-channel track for iTunes and Apple TV3 compatibility.
The only reason I want to preserve anything more than 2-channel is for the future when it becomes supported in iTunes/AppleTV (3 or 4 etc.)
Any help at all with this would be immensely appreciated! Thank you!
My issue is this: I am converting MKV files (sometimes AVI or FLV), and I am having one issue when using the AppleTV 3 preset you have designated. When using the "--verbose" command, I notice that there are instances in the injected code for each file that essentially requests the file to encode audio tracks into AC3 files (ffac3). Here's an example: "AC3 Passthru requested and input codec is not AC3 for track 2, using AC3 encoder
AC3 Passthru requested and input codec is not AC3 for track 4, using AC3 encoder"
Basically, all of my files have one or more language audio tracks (almost always more than one) and almost all of them (though sometimes none) have subtitles.
My only issue is that when I use the --preset AppleTV 3 command to ensure what I am encoding works with iTunes, I get an extra track for every AAC track that is AC-3. In some instances when the original track was AC-3 6channel I definitely want those original 6-channel AC3 tracks to stay in the M4V file. For anything more than 2 channels, I want it converted to an AC-3 equivalent. However, since I am batch encoding hundreds of files (tv show series and movies), I am forced to open all these files using Subler and individually remove the AC3-2channel tracks, while being careful keep any AC-3 6-Channel tracks.
I realize that the best way for me to state what I am trying to accomplish is this: Convert all audio tracks to AAC (AppleTV3 preset). If the original is AAC 6-channel, then (unless I am mistaken for iTunes and AppleTV compatibility), I want to retain the AAC 6-Channel while having an extra AAC 2-channel track mixdown to work with Apple TV 3. I want the same to be true for any AC-3 6 channel audio tracks. I never want an AC-3 2-channel track since I will always have/need the AAC 2-channel track for iTunes and Apple TV3 compatibility.
The only reason I want to preserve anything more than 2-channel is for the future when it becomes supported in iTunes/AppleTV (3 or 4 etc.)
Any help at all with this would be immensely appreciated! Thank you!
Re: [Script] rip all episodes or only main-feature from DVD
Can you post the used command?
Al
Al
Re: [Script] rip all episodes or only main-feature from DVD
AlBundy, I just finished to do a part of my ISO Batch conversion to MKV, everything when well, but I still need your help if possible. I got an unforeseen problem that I didn't get when I was testing the script, some of my ISO had corrupted VOB File, that resulted in a uncompleted converted file. I found the problem when doing a quick check of the converted file since no error is reported, so after that I had no choice to check all files to see if the movie credit was present at the end of the movie. This is a tedious operation, there must be a better way.
Do you think it's possible to report an error in the overview section, may be something like this:
z:/Film/Bad_Film.ISO
--> e:/mkv/Bad_Film.mkv [Uncompleted]
I don't know if the script can detect the error when the conversion process stop or if you will have to compare the time length of the source versus the time length of the converted file. If you compare time length, what is best to compare the exact time or a +/- 10 seconds will create less false detect. Hopefully it's feasible.
Thanks again for the script save me a lot of time.
Do you think it's possible to report an error in the overview section, may be something like this:
z:/Film/Bad_Film.ISO
--> e:/mkv/Bad_Film.mkv [Uncompleted]
I don't know if the script can detect the error when the conversion process stop or if you will have to compare the time length of the source versus the time length of the converted file. If you compare time length, what is best to compare the exact time or a +/- 10 seconds will create less false detect. Hopefully it's feasible.
Thanks again for the script save me a lot of time.
Re: [Script] rip all episodes or only main-feature from DVD
Quick and dirty for windows, add a loop for title numbers if you want. Just drop the batch in a folder of DVDs and let er rip.
Code: Select all
set handbrake="C:\Program Files\Handbrake\HandBrakeCLI.exe"
for /d %%a in (*) do start "encode" /b /low /wait %handbrake% -i "%%a" -t 1 -o "x:\dir\%%a-t1.mp4" -m -f mp4 --detelecine --decomb="fast" --strict-anamorphic -e x264 -q 20 --cfr -a -E faac -B 128 -6 dpl2 -R Auto -D 0 --audio-fallback faac --audio eng --subtitle 1,2,3,4,5,6,7,8,9,10 -x ref=4:weightp=1:rc-lookahead=80:trellis=0:8x8dct=0 --verbose=1
for /d %%a in (*) do start "encode" /b /low /wait %handbrake% -i "%%a" -t 2 -o "x:\dir\%%a-t2.mp4" -m -f mp4 --detelecine --decomb="fast" --strict-anamorphic -e x264 -q 20 --cfr -a -E faac -B 128 -6 dpl2 -R Auto -D 0 --audio-fallback faac --audio eng --subtitle 1,2,3,4,5,6,7,8,9,10 -x ref=4:weightp=1:rc-lookahead=80:trellis=0:8x8dct=0 --verbose=1
Last edited by ty2010 on Sat Jun 01, 2013 6:30 am, edited 1 time in total.
Re: [Script] rip all episodes or only main-feature from DVD
Your variable name is just plain wrong.
Re: [Script] rip all episodes or only main-feature from DVD
It was a less convoluted batch than the ffmpeg one i was using for remuxing, it should be a positive thing like the BMW driver with a Cadillac mug in the cup holder, it's what they *used* to drive. At least it wasn't something I was really frustrated with else there could have been variable names not appropriate for mixed company :/Rodeo wrote:Your variable name is just plain wrong.
I once used a variable for handbrake for batch reading of jobs and made an unfortunate condensation for a variable name that made me spit coffee on my keyboard after I typed it.
Re: [Script] rip all episodes or only main-feature from DVD
I've uploaded a new version that
- displays all tracks and subtitles from input before conversion
- filesize, duration, tracks and subtitles of output-file in overview.
Al
[edit]
Upload on mediafire does not work currently - I'll upload the new archive as soon as possible.
[/edit]
- displays all tracks and subtitles from input before conversion
- filesize, duration, tracks and subtitles of output-file in overview.
Al
[edit]
Upload on mediafire does not work currently - I'll upload the new archive as soon as possible.
[/edit]
Re: [Script] rip all episodes or only main-feature from DVD
New version is uploaded.
Re: [Script] rip all episodes or only main-feature from DVD
Thanks.. script is useful. So far encodings seem to be working well with it and solves a number of problems I was looking at before.
One thing I did have to hack on top of this was a different way to handle foreign language movies. By default I prefer to only include 1 language of audio track (English). However, when I have a movie whose main/first audio track is in a foreign language but also has a dubbed sound track, I prefer to put both in (and subtitles of course). As far as I could tell, it was not possible to do this by default as the script only allows you to specify a static list of languages.
To do this it was necessary to do a little pre-processing on the movies to figure out if there was an alternate language audio track that was probably the original audio. I wrote a little perl jobber which runs handbrake in scan mode and tries to identify the language of the first audio track of the video. The script itself is kind of a nasty hack and you may know a better way to identify the information but it worked for me. I then take the output of this perl script in my shell script wrapper and adjust my command-line options to hb.rb.
Anyway, just figured I would suggest that as a feature to implement within hb.rb itself as it has been useful for me. I've also attached my (very hacked together) perl/script code to show you what I'm doing.
Perl script:
Shell snippet that grabs the returned code:
As an example, on Crouching Tiger, Hidden Dragon, the perl script identifies the first track as Chinese (outputs: zho). My script then calls hb.rb with --audio zho,eng and I get both audio tracks encoded.
Thanks again for the script.
One thing I did have to hack on top of this was a different way to handle foreign language movies. By default I prefer to only include 1 language of audio track (English). However, when I have a movie whose main/first audio track is in a foreign language but also has a dubbed sound track, I prefer to put both in (and subtitles of course). As far as I could tell, it was not possible to do this by default as the script only allows you to specify a static list of languages.
To do this it was necessary to do a little pre-processing on the movies to figure out if there was an alternate language audio track that was probably the original audio. I wrote a little perl jobber which runs handbrake in scan mode and tries to identify the language of the first audio track of the video. The script itself is kind of a nasty hack and you may know a better way to identify the information but it worked for me. I then take the output of this perl script in my shell script wrapper and adjust my command-line options to hb.rb.
Anyway, just figured I would suggest that as a feature to implement within hb.rb itself as it has been useful for me. I've also attached my (very hacked together) perl/script code to show you what I'm doing.
Perl script:
Code: Select all
#!/usr/bin/perl
use strict;
use warnings;
my $main = 0;
my $audio = 0;
open HANDBRAKE, "HandBrakeCLI --scan --main-feature --input . 2>&1 |"
or die "unable to run HandBrakeCLI: $!\n";
while (<HANDBRAKE>){
if (/^Found main feature title/){
$main++;
}
if ($main and /^ \+ audio tracks:/){
$audio++;
}
if ($audio and /^ \+ 1, .*? \(iso.*?: (.*?)\)/){
print "$1\n";
exit;
}
}
close HANDBRAKE;
Code: Select all
LANG=`~/bin/determineNativeLang.pl`
if [[ "$LANG" != "" ]]; then
LANG="$LANG,eng"
else
LANG="eng"
fi
Thanks again for the script.
Re: [Script] rip all episodes or only main-feature from DVD
I'll think about it but what subtitles did you expect?
zho, eng or both?
Al
zho, eng or both?
Al
Re: [Script] rip all episodes or only main-feature from DVD
No worries if not.. my solution works for me.
The use case only makes sense for the audio language I think. Essentially it is giving 2 options: watch with original audio + English subtitles or watch dubbed version [where subtitles aren't neeeded]. So only the native language of subtitles are needed.
The use case only makes sense for the audio language I think. Essentially it is giving 2 options: watch with original audio + English subtitles or watch dubbed version [where subtitles aren't neeeded]. So only the native language of subtitles are needed.
Re: [Script] rip all episodes or only main-feature from DVD
I just finished encoding all of my DVDs with your script and now I'm up for the Blurays. Is there a way to get rid of the decomb? Since Blurays are 1080p theres no need for it but it slows the whole process down. Maybe you could add a --bluray option which will automatically set -4 (because file size will most likely be >4 GB, and if it's not set it will fail at the very last step of creating the file) and unset decomb? (or just a --nodecomb option?)
Or will --xtra "-decomb=0" do the trick?
Thanks a lot.
Or will --xtra "-decomb=0" do the trick?
Thanks a lot.
Re: [Script] rip all episodes or only main-feature from DVD
If handbrake supports --decomb=0 it should work.
But I've uploaded a new version with following new options
Al
But I've uploaded a new version with following new options
Code: Select all
--lang LANGUAGES set subtitle and audio languges
--bluray disables decomb and enables support for mp4-files over 4GB
Re: [Script] rip all episodes or only main-feature from DVD
Hi All, I just registered for the forum. I have also written a Ruby program to allow me to rip DVD TV series. AlBundy, I believe your script is more comprehensive than mine. However, one thing mine does that may be of interest is that it automatically looks up all of the episode information for the show and names each episode accordingly. I was wondering if you'd be interested in combining our two efforts into a better product? If so please let me know here and I'll pass along the code repository so we can collaborate.
Cheers!
Cheers!
Re: [Script] rip all episodes or only main-feature from DVD
Hi, I also have a separate script to name and tag the converted files.
Because this is currently only working with serienjunkies.de (a german site only for episodes) and needs special gems it's not integrated in hb.rb
If you show me your script, I might get an idea how to integrate both in hb.rb
Al
Because this is currently only working with serienjunkies.de (a german site only for episodes) and needs special gems it's not integrated in hb.rb
If you show me your script, I might get an idea how to integrate both in hb.rb
Al
Re: [Script] rip all episodes or only main-feature from DVD
Do you have a bitbucket.org account? They are free. I will add you to the repository if you can give me your account username.
Re: [Script] rip all episodes or only main-feature from DVD
I don't have an account - maybe you can upload your script at a free filehoster.
Re: [Script] rip all episodes or only main-feature from DVD
Just found your script and trying in FreeBSD 9.1. If you change:
to
then you should not need to run:
as it should find ruby in any *nix or *bsd.
Thanks for this script.
Code: Select all
#!/usr/bin/ruby
Code: Select all
#!/usr/bin/env ruby
Code: Select all
ruby hb.rb
Thanks for this script.
Re: [Script] rip all episodes or only main-feature from DVD
I've changed the shebang to - change will be available in next version.
Thanks for the suggestion
Al
Code: Select all
#!/usr/bin/env ruby
Thanks for the suggestion
Al
Re: [Script] rip all episodes or only main-feature from DVD
I've got the code here on bitbucket.org. I use the imdb gem to lookup the episodes and automatically name them. Feel free to clone it or get some ideas from it. I'm still working on specs but plan to have 100% test coverage eventually. Any help from Ruby programmers is appreciated.