Accessing the scaled size via CLI?

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.
Post Reply
griffitts
Posts: 3
Joined: Fri Nov 04, 2022 12:56 am

Accessing the scaled size via CLI?

Post by griffitts »

When loading a file in the app, I'm assuming there's some crop detection going on and then that width and height appears as the scaled size. Is there any way to access that scaled size width and height via the CLI?
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Accessing the scaled size via CLI?

Post by mduell »

Parse the output of the scan with -t 0 looking for the relevant line.
griffitts
Posts: 3
Joined: Fri Nov 04, 2022 12:56 am

Re: Accessing the scaled size via CLI?

Post by griffitts »

For my file, the app shows a scaled size of 954x720.

The scan shows size: 1280x720, autocrop: 0/0/166/160

Subtracting the last 2 autocrop values from the width gives me scaled size width. So is the right approach to subtract the first 2 autocrop values from length and the last 2 values from width to get the scaled size?
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Accessing the scaled size via CLI?

Post by mduell »

The autocrop values are top/bottom/left/right, so yes.

It's confusing when you say scaled when you mean cropped.
griffitts
Posts: 3
Joined: Fri Nov 04, 2022 12:56 am

Re: Accessing the scaled size via CLI?

Post by griffitts »

Just using the terminology from the app.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Accessing the scaled size via CLI?

Post by mduell »

The cropped dimensions are only the scaled dimensions if you're not doing any scaling after cropping.
Post Reply