I've been looking for examples for X265 that I can run from a windows command prompt.
I understand the basic syntax but I don't see some of the options for X265 when I look at the FAQ.
Basically I want to translate the options that I use in the GUI into the command line so I can run it as a postprocessing script.
I am not changing the video resolution, no filters, on the video tab the options I have set are
Codec - H265
Quality - 20
Framerate - Same as Source (variable)
X265 Preset - Medium
X265 Tune - None
h.265 Profile - Main
Audio - copy the existing AC3 track
So it would be something like this
handbrakecli -i c:\temp\old.mkv -o c:\temp\new.mkv -e x265 -q 20 --vfr --x265-preset medium --x265-tune none --x265-profile main -E copy:ac3
But I don't see options in the FAQ for x265 tune, x265 preset or x265 profile... so maybe X265 encoding from the command line isn't possible yet? Or maybe it is and I just have the syntax wrong...
X265 Windows example?
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: X265 Windows example?
--encoder-preset, --encoder-tune, --encoder-profile
Re: X265 Windows example?
For tune none, you may also not specify any tune, none is the default.
Re: X265 Windows example?
Ok so that means it's this?
handbrakecli -i c:\temp\old.mkv -o d:\temp\new.mkv -e x265 -q 20 --vfr --encoder-preset medium --encoder-profile main -E copy:ac3
Also how would I specify a wildcard... like if I want to encode the entire source folder *.mkv to a different destination folder without having to enter a command line for each file name? Or is that not possible?
handbrakecli -i c:\temp\old.mkv -o d:\temp\new.mkv -e x265 -q 20 --vfr --encoder-preset medium --encoder-profile main -E copy:ac3
Also how would I specify a wildcard... like if I want to encode the entire source folder *.mkv to a different destination folder without having to enter a command line for each file name? Or is that not possible?
Re: X265 Windows example?
Encoding more than one file requires scripting, external to handbrake. It's easy enough to do, but the details depend upon what command interpreter you are using. A lot of people use PowerShell in Windows, but it can be done with batch files in CMD.
The script would determine what files are in the directory, then call handbrake once for each one.
The script would determine what files are in the directory, then call handbrake once for each one.
Re: X265 Windows example?
So there's no built in way to say point handbrake to an input directory and an output directory... instead I would have to read in the name of each of the source files and then execute the command line with that source and destination file name..
Thanks for your help Rodeo and Woodstock
Thanks for your help Rodeo and Woodstock
Re: X265 Windows example?
For the command line, correct - there isn't anything built in.
However, if you search this section, there are examples of scripts written for several different command interpreters that will do what you're asking for.
I can't make specific recommendations because I don't use any of them.... but the ones intended for use with PowerShell would have more options than one written for CMD.EXE.
I use a text editor to create batch files for my needs. Here is an example of a batch file with argument substitution to process a single file from the command line. The input and output paths are hard-coded, because of how I do things:
Called with an argument of "Fairy Tail HD001.mkv", it substitutes "Fairy Tail HD001" everywhere the "%~n1" is found.
However, if you search this section, there are examples of scripts written for several different command interpreters that will do what you're asking for.
I can't make specific recommendations because I don't use any of them.... but the ones intended for use with PowerShell would have more options than one written for CMD.EXE.
I use a text editor to create batch files for my needs. Here is an example of a batch file with argument substitution to process a single file from the command line. The input and output paths are hard-coded, because of how I do things:
Code: Select all
title "%~n1" & "C:\Program Files\Handbrake\HandBrakeCLI.exe" -i "Z:\Fairy Tail\%~n1.mkv" -t 1 -o "V:\Anime\dubbed\Fairy Tail\%~n1.mkv" -f mkv --strict-anamorphic -e x264 -q 20 --vfr -a 1,2,4 -E faac,copy:ac3,faac -B 160,0,160 -6 dpl2,auto,dpl2 -R Auto,Auto,Auto -D 0,0,0 --gain=0,0,0 --audio-copy-mask none --audio-fallback ffac3 --subtitle 2,1 --markers="C:l\Temp\Fairy Tail HD-chapters.csv" -x ref=1:weightp=1:subq=2:rc-lookahead=10:trellis=0:8x8dct=0 --verbose=1