Adapting GUI encode settings to handbrakecli

Discussion of the cross-platform 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
garethrobson
Posts: 7
Joined: Fri Apr 21, 2017 8:43 am

Adapting GUI encode settings to handbrakecli

Post by garethrobson » Fri Aug 11, 2017 12:49 pm

Hi,

This has probably been asked a thousand times but I cant find any useful info.

Is there an easy way to adapt an already functioning GUI profile form the Nightly build of handbrake (Im using H265) into a handbrakecli command?
I created all the options I want in the GUI but Im finding making a handbrakecli version of the same encode is difficult.

User avatar
BradleyS
Moderator
Posts: 1126
Joined: Thu Aug 09, 2007 12:16 pm

Re: Adapting GUI encode settings to handbrakecli

Post by BradleyS » Fri Aug 11, 2017 12:57 pm

Save a custom preset in the GUI and then access it using HandBrakeCLI --preset-import-gui --preset="My Preset"

mduell
Veteran User
Posts: 5774
Joined: Sat Apr 21, 2007 8:54 pm

Re: Adapting GUI encode settings to handbrakecli

Post by mduell » Fri Aug 11, 2017 6:16 pm

You can use the GUI preset import as a crutch, but in the long term you're way better off learning the relatively straightforward CLI syntax instead of depending on the angry spaghetti GUI.

DougH
Posts: 18
Joined: Fri Sep 23, 2016 12:52 am

Re: Adapting GUI encode settings to handbrakecli

Post by DougH » Fri Aug 11, 2017 10:21 pm

One note about exporting a custom preset from the GUI, you may need to edit the JSON file because some GUI values aren't supported in the CLI. For example some fields are marked as null and the CLI doesn't like this. You're best bet is to do a short encode with your preset and then check the log to see if there's errors and fix them. That's what I had to do. Eventually I used the CLI to build my preset because I do 99.99% of my encoding from the CLI.

User avatar
Rodeo
HandBrake Team
Posts: 11805
Joined: Tue Mar 03, 2009 8:55 pm

Re: Adapting GUI encode settings to handbrakecli

Post by Rodeo » Fri Aug 11, 2017 10:34 pm

DougH wrote:
Fri Aug 11, 2017 10:21 pm
One note about exporting a custom preset from the GUI, you may need to edit the JSON file because some GUI values aren't supported in the CLI. For example some fields are marked as null and the CLI doesn't like this.
That should be reported as a bug please :)

DougH
Posts: 18
Joined: Fri Sep 23, 2016 12:52 am

Re: Adapting GUI encode settings to handbrakecli

Post by DougH » Sat Aug 12, 2017 5:54 pm

I reported it. :)

garethrobson
Posts: 7
Joined: Fri Apr 21, 2017 8:43 am

Re: Adapting GUI encode settings to handbrakecli

Post by garethrobson » Mon Aug 21, 2017 3:41 pm

Sorry for the delayed reply.
I fear my situation may be complicated and may mean this isnt possible so I have a couple of questions:

I currently have a handbrake convert script set up that runs and works fine for non 4k items.
My 4k stuff at the moment isnt automatically converted (Im manually using the GUI) but I want it to be. Most of the stuff is HDR so I opted for the Nightly build with 10 bit support and have this working really well using the GUI.

so...
* Do I still need to use the nightly build to achieve 10 bit encoding or is this now supported on the main branch?
* Will the fact that I have to use the extra DLLs affect using HANDBRAKECLI?
* I have no HANDBRAKECLI.exe file in my nightly build...do I need to install this seperately?
* Would it matter if I scripted ALL 4k content (even non HDR stuff) to be encoded in 10 bit or would this not work? I understand there would probably be no benefit in converting a non HDR file to 10 bit but it makes my scripting much less complicated.

mduell
Veteran User
Posts: 5774
Joined: Sat Apr 21, 2007 8:54 pm

Re: Adapting GUI encode settings to handbrakecli

Post by mduell » Mon Aug 21, 2017 4:51 pm

The 10 bit encoding is a bit pointless, since the HB video pipeline is all 8 bit, so the bits have already been lost before it gets to the encoder.

garethrobson
Posts: 7
Joined: Fri Apr 21, 2017 8:43 am

Re: Adapting GUI encode settings to handbrakecli

Post by garethrobson » Mon Aug 21, 2017 5:34 pm

If I don't use 10 bit though I lose the HDR status?

mduell
Veteran User
Posts: 5774
Joined: Sat Apr 21, 2007 8:54 pm

Re: Adapting GUI encode settings to handbrakecli

Post by mduell » Mon Aug 21, 2017 6:25 pm

You've lost the actual HDR regardless if you use a 10 bit encoder or not.

garethrobson
Posts: 7
Joined: Fri Apr 21, 2017 8:43 am

Re: Adapting GUI encode settings to handbrakecli

Post by garethrobson » Mon Aug 21, 2017 6:29 pm

But when I just choose x265 my TV does not report it's HDR and the colour quality is not great. Choose 10 bit and it says HDR and the colours are much more vivid.

I'm not calling you a liar by any means you sound like you know much more about this than me, but there's certainly a difference in colour quality and not just on 1 TV.

User avatar
Rodeo
HandBrake Team
Posts: 11805
Joined: Tue Mar 03, 2009 8:55 pm

Re: Adapting GUI encode settings to handbrakecli

Post by Rodeo » Mon Aug 21, 2017 6:30 pm

mduell wrote:
Mon Aug 21, 2017 6:25 pm
You've lost the actual HDR regardless if you use a 10 bit encoder or not.
When using HandBrake, that is. But mudell is indeed correct -- if you want "HDR" video, you need to use an application that supports 10-bit internally, which HB doesn't.

10-bit in HandBrake merely gives you a minor boost in compression efficiency as well as slightly reduces the risk of banding and similar artifacts.

garethrobson
Posts: 7
Joined: Fri Apr 21, 2017 8:43 am

Re: Adapting GUI encode settings to handbrakecli

Post by garethrobson » Mon Aug 21, 2017 7:10 pm

Hmm ok in that case this whole topic is probably pointless.
I was using handbrake to bring the bitrate down slightly as my Android TV for some reason is very "jittery" in anything with a reasonably sized bitrate.

IL go back to the drawing board.

User avatar
BradleyS
Moderator
Posts: 1126
Joined: Thu Aug 09, 2007 12:16 pm

Re: Adapting GUI encode settings to handbrakecli

Post by BradleyS » Mon Aug 21, 2017 7:23 pm

If it's connected over wifi, that could be the bottleneck.

mduell
Veteran User
Posts: 5774
Joined: Sat Apr 21, 2007 8:54 pm

Re: Adapting GUI encode settings to handbrakecli

Post by mduell » Mon Aug 21, 2017 7:28 pm

garethrobson wrote:
Mon Aug 21, 2017 6:29 pm
But when I just choose x265 my TV does not report it's HDR and the colour quality is not great. Choose 10 bit and it says HDR and the colours are much more vivid.

I'm not calling you a liar by any means you sound like you know much more about this than me, but there's certainly a difference in colour quality and not just on 1 TV.
I would not be surprised if your TV was changing brightness/contrast/saturation/etc when it detects HDR content, to make it appear better. You could make the same adjustments for non-HDR content.

But HB is going to downconvert everything to 8 bit along the way, regardless of input and output formats.

garethrobson
Posts: 7
Joined: Fri Apr 21, 2017 8:43 am

Re: Adapting GUI encode settings to handbrakecli

Post by garethrobson » Mon Aug 21, 2017 7:30 pm

I'm running through a cabled connection. I can happily perform a network speed test and get 100mbit connection speeds (max due to cabling in the wall) and IV tried various media players, some better than others but the TV just struggles. I even tried to play a HDR 4k sample video I got from the internet from the on board storage but I got about 3fps. I think that was a fairly hefty bitrate though

garethrobson
Posts: 7
Joined: Fri Apr 21, 2017 8:43 am

Re: Adapting GUI encode settings to handbrakecli

Post by garethrobson » Mon Aug 21, 2017 7:45 pm

IV just had a thought...maybe it's not the video or the bitrate that's the issue. Maybe my TV doesn't like / support the audio codec and is trying to software decode?

Is there a way in handbrake to just convert audio so I can test, or do you know of any software I can test this theory with?

DougH
Posts: 18
Joined: Fri Sep 23, 2016 12:52 am

Re: Adapting GUI encode settings to handbrakecli

Post by DougH » Fri Aug 25, 2017 1:33 am

No, HandBrake won't just encode Audio. If you want to use HB I'd just encode a short clip, say 5-10 minutes using the --start-at --stop-at switches and then just encode with various audio settings until you find one that works.

ffmpeg can copy video and re-encode audio but I have little experience with ffmepg. If your sources are MKVs you could use mkvtoolnix to extract the audio and then use another program to encode it for testing.

Post Reply