Addition of letterboxing (AKA padding)
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.
Addition of letterboxing (AKA padding)
Description of problem or question:
I have an AVC clip that's 1296x1080 and I want to add letterboxing at the top and the bottom, let's say 20px each. I tried the --pad command in the advanced options, but it doesn't seem to work. Supposedly padding only works with HandbrakeCLI for some reason.
Can I...
- set everything up in the GUI version of Handbrake
- export the queue as .json
- modify the line with the advanced options
- execute the .json script in HandbrakeCLI?
Is this command correct?
--pad="width=1296:height=1120:color=black:x=20:y=20" -h 1120
I really need some help as all this information is barely documented. Why can't I do that with the Handbrake GUI?
Steps to reproduce the problem (If Applicable):
-
HandBrake version (e.g., 1.0.0):
1.3.1
Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Windows 10 1909
Activity log: https://pastebin.com/RMEfysVP
I have an AVC clip that's 1296x1080 and I want to add letterboxing at the top and the bottom, let's say 20px each. I tried the --pad command in the advanced options, but it doesn't seem to work. Supposedly padding only works with HandbrakeCLI for some reason.
Can I...
- set everything up in the GUI version of Handbrake
- export the queue as .json
- modify the line with the advanced options
- execute the .json script in HandbrakeCLI?
Is this command correct?
--pad="width=1296:height=1120:color=black:x=20:y=20" -h 1120
I really need some help as all this information is barely documented. Why can't I do that with the Handbrake GUI?
Steps to reproduce the problem (If Applicable):
-
HandBrake version (e.g., 1.0.0):
1.3.1
Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Windows 10 1909
Activity log: https://pastebin.com/RMEfysVP
Re: Addition of letterboxing (AKA padding)
The PAD filter is only implemented in the CLI, so your experiment with the advanced options in the GUI wasn't going to work.
If everything you want is set up in a preset, you can tell the CLI to load that, AND add the --pad command to that. Since you're only adding top/bottom padding, you should leave the x=20 part out, or you will have the picture off to the side.
If everything you want is set up in a preset, you can tell the CLI to load that, AND add the --pad command to that. Since you're only adding top/bottom padding, you should leave the x=20 part out, or you will have the picture off to the side.
Re: Addition of letterboxing (AKA padding)
Can you be a bit more specific, please?Woodstock wrote: ↑Tue Mar 24, 2020 8:00 pm The PAD filter is only implemented in the CLI, so your experiment with the advanced options in the GUI wasn't going to work.
If everything you want is set up in a preset, you can tell the CLI to load that, AND add the --pad command to that. Since you're only adding top/bottom padding, you should leave the x=20 part out, or you will have the picture off to the side.
Should I do everything in the GUI (including the advanced settings), export the queue to .json and then just do this in CMD?
HandBrakeCLI --preset-import-file EXAMPLE.json -i C:\inputfile.mp4 -o C:\outputfile.mp4
with advanced settings looking like this:
--pad="width=1:height=1340:color=black:y=20" -h 1120
Re: Addition of letterboxing (AKA padding)
Can't find a way to edit the previous post. I just want to say that the last line is supposed to have "1296" after "width=" and not just "1".
Re: Addition of letterboxing (AKA padding)
In addition to the --preset-import, you have to specify the name of the preset (the file import can have multiple presets in it). That will get the rest of your settings put in place, so the --pad can just add the letterbox top/bottom.
Re: Addition of letterboxing (AKA padding)
This is such a hassle.
Can I just set everything up in the GUI, export the preset to JSON, open it in a text editor, set "x264UseAdvancedOptions" at the bottom to "true" and somehow input the "pad" command below?
That way I'd only need to execute one script in CLI, as executing two JSONs (one with my custom preset and the other with the additional advanced options) doesn't work no matter what I do.
https://superuser.com/questions/783373/ ... ndbrakecli
Can I just set everything up in the GUI, export the preset to JSON, open it in a text editor, set "x264UseAdvancedOptions" at the bottom to "true" and somehow input the "pad" command below?
That way I'd only need to execute one script in CLI, as executing two JSONs (one with my custom preset and the other with the additional advanced options) doesn't work no matter what I do.
https://superuser.com/questions/783373/ ... ndbrakecli
- -Z is only for built-in presets. and the import options (--preset-import-file and --preset-import-gui) dont successfully work with an exported preset (.json) from the gui. and instead of failing, they default to x264/rf22
Re: Addition of letterboxing (AKA padding)
No. x264 doesn't do padding, it's a video encoder only. The pad filter is a HandBrake filter, whatever options you pass to x264 will not be able to add HandBrake's pad filter which x264 knows nothing about.
Re: Addition of letterboxing (AKA padding)
So I did this:
HandBrakeCLI --preset-import-file "C:\Program Files\HandBrake\HandBrakeCLI\OHOHOHO.json" --pad="width=1296:height=1120:color=black:x=20:y=20" -i D:\SAMPLE.mkv -o D:\SAMPLE_1.mp4
OHOHOHO.json looks like this: https://pastebin.com/SEmE8DiD
The bars were added, but the video bitrate is 3500 kbps and the audio bitrate is 128 kbps, even though they were set to 6000 and 256 respectively. It looks like HB defaulted to one of the default presets.
Log: https://pastebin.com/GWVTeHjD
HandBrakeCLI --preset-import-file "C:\Program Files\HandBrake\HandBrakeCLI\OHOHOHO.json" --pad="width=1296:height=1120:color=black:x=20:y=20" -i D:\SAMPLE.mkv -o D:\SAMPLE_1.mp4
OHOHOHO.json looks like this: https://pastebin.com/SEmE8DiD
The bars were added, but the video bitrate is 3500 kbps and the audio bitrate is 128 kbps, even though they were set to 6000 and 256 respectively. It looks like HB defaulted to one of the default presets.
Log: https://pastebin.com/GWVTeHjD
- JohnAStebbins
- HandBrake Team
- Posts: 5725
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Addition of letterboxing (AKA padding)
According to the log you posted, you set video quality to RF 22 (not 6000kbps ABR encoding) and audio bitrate to 128kbps.
- JohnAStebbins
- HandBrake Team
- Posts: 5725
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Addition of letterboxing (AKA padding)
Ah, you didn't tell it to use the preset you imported. -Z or --preset
Re: Addition of letterboxing (AKA padding)
-Z only works with the presets available in Handbrake GUI ("Very Fast 1080p30" etc.).JohnAStebbins wrote: ↑Wed Mar 25, 2020 5:49 pm Ah, you didn't tell it to use the preset you imported. -Z or --preset
I used --preset-import-file "C:\Program Files\HandBrake\HandBrakeCLI\OHOHOHO.json". Why doesn't that work?
Can somebody please just tell me EXACTLY what I should do? I tried to avoid being spoonfed, but I'm running out of ideas.
Last thing I can think of is editing AppData\Roaming\HandBrake\presets.json so that I can just use the "-Z. --preset" command and add the padding commaned after that.
Re: Addition of letterboxing (AKA padding)
Nevermind. I just learned about VidCoder and it did exactly what I wanted.
I like Handbrake, but it really needs more detailed documentation and a few more options.
I like Handbrake, but it really needs more detailed documentation and a few more options.
Re: Addition of letterboxing (AKA padding)
This is all covered in the documentation available in HandBrake.exe --help
- JohnAStebbins
- HandBrake Team
- Posts: 5725
- Joined: Sat Feb 09, 2008 7:21 pm
Re: Addition of letterboxing (AKA padding)
Wrong-Z only works with the presets available in Handbrake GUI ("Very Fast 1080p30" etc.).
--preset-import-file can be used to import multiple files and a file can contain multiple presets. Therefore, you also must tell it what preset to use.I used --preset-import-file "C:\Program Files\HandBrake\HandBrakeCLI\OHOHOHO.json". Why doesn't that work?
I thought I hadCan somebody please just tell me EXACTLY what I should do?
Glad you found a solution that works for you.Nevermind. I just learned about VidCoder and it did exactly what I wanted.
Re: Addition of letterboxing (AKA padding)
That question was already answered earlier:BaconKoss wrote: ↑Wed Mar 25, 2020 6:09 pm-Z only works with the presets available in Handbrake GUI ("Very Fast 1080p30" etc.).JohnAStebbins wrote: ↑Wed Mar 25, 2020 5:49 pmAh, you didn't tell it to use the preset you imported. -Z or --preset
I used --preset-import-file "C:\Program Files\HandBrake\HandBrakeCLI\OHOHOHO.json". Why doesn't that work?