Here is how I converted all raw mts files from camera using handbrakecli from command line (here I used bash command line in mobaxterm)
First, I checked in handbreak GUI log file which options were used when I was convering single mts from GUI. Having this I created file with options (in example named 'opcyje') which I later used for batch processing.
[mobaxterm] ➤ ls *.mts
00139.MTS 00141.MTS 00143.MTS 00145.MTS 00147.MTS 00149.MTS 00151.MTS 00153.MTS
00140.MTS 00142.MTS 00144.MTS 00146.MTS 00148.MTS 00150.MTS 00152.MTS 00154.MTS
[mobaxterm] ➤ cat opcyje
-i **${i}** -t 1 --angle 1 -c 1 -o **${i%.*}**.mp4 -f mp4 -w 1920 --crop 0:0:0:0 --loose-anamorphic --modulus 2 -e x264 -q 20 --vfr -a 1 -E av_aac -6 dpl2 -R Auto -B 160 -D 0 --gain 0 --audio-fallback ac3 --encoder-preset=veryfast --encoder-level="4.0" --encoder-profile=main --verbose=1
[mobaxterm] ➤ type HandBrakeCLI.exe
HandBrakeCLI.exe is hashed (/cygdrive/c/Program Files/Handbrake/HandBrakeCLI.exe)
[mobaxterm] ➤ for i in *.mts;do eval HandBrakeCLI.exe $(cat opcyje);done
It worked perfectly.
Profiles will screw things up if the resize is larger than the current resolution. here it tries to convert all my 1920x1080 videos to 1700somethingx1080 because that is the resolution of my monitor – gcb – 2016-03-25T08:24:42.663
This one was a bit of a face slap, one needs to set the video size when adding/saving the preset; if not the size will always default to the source's, no matter the edits. – Dr1Ku – 2018-01-06T10:42:16.210