[Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

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.
Trogburn
Posts: 4
Joined: Sat Sep 19, 2015 10:16 pm

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by Trogburn » Sun Sep 20, 2015 8:38 pm

AlBundy wrote:I hope that your drc overrides my default because your value will be added later in command line.
You could try an encode with 0 and another with a very high value and compare the results.
Ok, I just did a test recording with --xtra "--drc 0.0" and another test recording with --xtra "--drc 4.0". This puts the first recording at the minimum DRC value via the command line, and the second recording at the maximum DRC value via the command line, to compare the results as you mentioned. The verbose INFO in the windows command prompt doesn't provide me with any guaranteed indicators that it succeeded so I am going to play each file here shortly, and then edit this post to let you know the actual results. What I should see, if it works, and overrides the default 0.0 value correctly in your script, is the first recording will still have LARGE gaps between the softest and loudest sounds in my movie (easily seen during action sequences / swells in soundtrack / etc), while the second recording will have the gaps between the softest and loudest sounds in the movie reduced significantly.
AlBundy wrote:What do you mean with that?
I was (and still am) curious if there is a way in the hb.rb settings/script to work with the GAIN? If I am in the Handbrake GUI there is an audio setting for most encoders called Gain that you can tweak to help amplify the encoding (since most encodings come out softer on sound level). And in Handbrake CLI to use this for the encoder, you type --gain <float>, like --gain 3.5. So, can we do the same directly in hb.rb or do I need to pass this via the --xtra tag as well? The main reason I am asking is I am not seeing it show up in the hb.rb section when I attempt to use it in the same manner... (shown in screenshot below - it would appear next to drc 0.0 I am guessing).

Image
Last edited by Trogburn on Mon Sep 21, 2015 4:09 am, edited 1 time in total.

AlBundy
Bright Spark User
Posts: 372
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by AlBundy » Sun Sep 20, 2015 9:01 pm

--xtra is ok to add the gain parameter.
You don't see gain in my arguments because I don't set a value.

You can enable writing the encode log to get the output of handbrake.

Al

Trogburn
Posts: 4
Joined: Sat Sep 19, 2015 10:16 pm

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by Trogburn » Mon Sep 21, 2015 4:22 am

Trogburn wrote:and then edit this post to let you know the actual results.
So instead of editing my last post as planned, since you had already responded before I got back to it with my tested results, I will just reply here. I verified that the Override is working correctly for DRC. I tested DRC 0.0 and DRC 4.0 (the max value) both via --xtra --drc <value> and there is a noticeable difference in the video during scenes where the audio is quieter on 0.0 (on 4.0 it is louder / normalized).

A good example if anyone wants to do this test as well and has the movie I was using (500 Days of Summer) is around 30-33 minutes in, when the guy is doing the dance montage down the street (which is very loud), and then enters his work building and co-workers are talking / almost whispering (the elevator shutting + him talking + the co-workers are all very quiet). So on DRC 0.0, you will notice the drastic difference in volume, but on DRC 4.0 you will see the volume levels normalized quite a bit.
AlBundy wrote:--xtra is ok to add the gain parameter.
You don't see gain in my arguments because I don't set a value.
As for GAIN, I tested this as well at the same time, and both my movies were boosted with GAIN 5.0, and I can verify that my audio stream was loud enough for my receiver to run at 26. When GAIN is set to 0.0 (default), I typically have to set my receiver to over 34+ for movies, especially during the quieter scenes.

Thanks for your help OP! Again, this script is a HUGE help, and I appreciate all the great work here!

For anyone looking for helpful final scripts, here are the two I am going to be using now for DVDs based on this research.

NON-DISNEY ANIMATION MOVIES + ALL OTHER MOVIES:

Code: Select all

hb.rb --input "H:\TEST\*\*.mkv" --main --titles 1 --output "I:\MOVIES (FS - Rips & Re-encodes)\#source_parentname#\#source_basename#.mkv" --autocrop --no-loose-anamorphic --skip-commentaries --quality 20 --decomb --detelecine --only-first-track-per-language --audio-track encoder=av_aac,mixdown=stereo,language=eng,arate=auto,bitrate=320 --xtra "-f mkv -e x264 --drc 2.5 --gain 5.0 --vfr -x level=4.1:no-fast-pskip:ref=4:bframes=8:b-adapt=2:direct=auto:me=umh:subme=10:merange=24:analyse=all:trellis=2:psy-rd=1.0,0.15:no-dct-decimate=1:deblock=-1,-1:vbv-bufsize=13000:vbv-maxrate=13000:crf=21:rc-lookahead=50 --verbose=1"
DISNEY ANIMATION MOVIES:

Code: Select all

hb.rb --input "H:\TEST\*\*.mkv" --main --titles 1 --output "I:\MOVIES (FS - Rips & Re-encodes)\#source_parentname#\#source_basename#.mkv" --autocrop --no-loose-anamorphic --skip-commentaries --quality 20 --decomb --detelecine --only-first-track-per-language --audio-track encoder=av_aac,mixdown=stereo,language=eng,arate=auto,bitrate=320 --xtra "-f mkv -e x264 --drc 2.5 --gain 5.0 --vfr -x level=4.1:no-fast-pskip:ref=4:bframes=8:b-adapt=2:direct=auto:me=umh:subme=10:merange=24:analyse=all:trellis=2:psy-rd=0.4,0.00:no-dct-decimate=1:deblock=1,1:vbv-bufsize=13000:vbv-maxrate=13000:crf=21:rc-lookahead=50 --verbose=1"
Keep in mind that these are my final scripts for DVDs. I would definitely tweak them a bit for BluRays (quality for instance should probably be adjusted).

alakar
Posts: 2
Joined: Sat Apr 22, 2017 10:45 pm

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by alakar » Sat Apr 22, 2017 10:48 pm

This breaks for me since the upgrade to HandBrake 1.x.x
Any chance we could get an updated version of the script?

AlBundy
Bright Spark User
Posts: 372
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by AlBundy » Sun Apr 23, 2017 12:43 pm

I've committed a new change to github to work with latest handbrakecli.

Al

alakar
Posts: 2
Joined: Sat Apr 22, 2017 10:45 pm

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by alakar » Fri Jun 02, 2017 10:25 pm

Is there an easy way to allow for an x265 encoder option?

AlBundy
Bright Spark User
Posts: 372
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by AlBundy » Sat Jun 03, 2017 4:48 pm

You can already add --encoder x265 to your command line.
Meybe this is enough - if not I can add more arguments.

ktverdun
Posts: 4
Joined: Sun Apr 21, 2013 2:42 pm

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by ktverdun » Sat Jan 19, 2019 4:01 pm

I've been using this handbrake script for years and it has been a great timesaver to skip having to use the handbrake ui.

I thought I would upgrade to the latest handbrakecli to take advantage of the newer presets, but cannot get hb_rb to recognize any presets in newer CLIs.

I've run through an upgrade to the latest version of everything to make sure all items were in sync based on the readme instructions:
  • Ruby+Devkit 2.5.3-1 (x64)
  • HandBrakeCLI-1.2.0-win-x86_64
  • The latest build from hb_rb
  • Run all of the ruby gems recommended in the readme
  • Tried rebooting too just to be on the safe side.
None of the handbrake presets work. If I revert back to a handbrakecli version that is older than 1.x.x, I have no issues and am able to use the old presets.

Is there a trick to getting the presets to work with the newer CLIs? My understanding from this thread is that the fix in 2017 was made to allow use of the new handbrakecli presets.

AlBundy
Bright Spark User
Posts: 372
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by AlBundy » Sat Jan 19, 2019 8:36 pm

I've pushed some changes to github - maybe they'll work.
The problem is that older versions of handbrake printed the list of cli-arguments.
Now I have to create the arguments from the exported json file with an older manicure.rb (to support older versions too).

You can give it a try if you want.

AlBundy
Bright Spark User
Posts: 372
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by AlBundy » Mon Jan 21, 2019 7:37 am

Did you try?

ktverdun
Posts: 4
Joined: Sun Apr 21, 2013 2:42 pm

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by ktverdun » Sat Feb 02, 2019 7:39 pm

Yes, that fix worked! Thank you!

Replop
Posts: 2
Joined: Sat Nov 02, 2019 4:02 pm

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by Replop » Mon Nov 04, 2019 1:37 pm

Hello and thanks a lot for this good too.
I had everything working just fine before but vas To fully reinstall my distro. Now I can encode but I canot have the french subtitles added.

Input are mkv with multiples subtitles tracks but when I do a --check subtitles are lit listed. Do you know if I'm doing something wrong here ? I will edit my post when I'm home.

Thanks

AlBundy
Bright Spark User
Posts: 372
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by AlBundy » Mon Nov 04, 2019 10:48 pm

Maybe different version of HandbrakeCLI or an issue with your file?

Replop
Posts: 2
Joined: Sat Nov 02, 2019 4:02 pm

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by Replop » Fri Nov 08, 2019 6:48 pm

Hey AlBundy sorry for the delay on the reply, just a new father here :)

Here is the version of HandBrakeCLI installed on the system :
HandBrake 1.2.1

Tried on multiple files and the same happens... Files I'm sure got subtitles in the container by having them available on The media player.

AlBundy
Bright Spark User
Posts: 372
Joined: Mon Dec 31, 2012 4:47 am

Re: [Script] convert episodes or main-feature from DVD or BD or convert multiple files (on any os)

Post by AlBundy » Fri Nov 08, 2019 7:20 pm

if you add the argument --verbose you should get more output.

And you can also try to load your file in Handbrake (CLI or GUI) to check if handbrake shows subtitles.

Post Reply