Help with Handbrake CLI

Hey all,
I am trying to get HandbrakeCLI working for a simple task but I am not very experienced with terminal. Would someone care to help? Basically I need the output filename to be the same as whatever the input is. Once this is working I will automate it with Hazel, of course.
I found this 10 year old thread https://www.noodlesoft.com/forums/viewtopic.php?f=4&t=2136 but could not understand how the variables are set up. Surely the answers already there but I can't understand it.
Many thanks.
I am trying to get HandbrakeCLI working for a simple task but I am not very experienced with terminal. Would someone care to help? Basically I need the output filename to be the same as whatever the input is. Once this is working I will automate it with Hazel, of course.
I found this 10 year old thread https://www.noodlesoft.com/forums/viewtopic.php?f=4&t=2136 but could not understand how the variables are set up. Surely the answers already there but I can't understand it.
Many thanks.