Renaming the converted file

Currently I have some rules to convert some video to .mp4 using the HandbrakeCLI. And right now the converted file includes the extension of the original filename. Can someone help me rename the file that was converted so that the old extension is not there?
Original file name: test.ts.mp4
Converted name: test.ts.mp4
What I'd like: test.mp4
Currently my script:
I'd be happy to create a rule that could rename the file after this if no one can help me with the script, but I can't figure out that either.
Thanks all!
Original file name: test.ts.mp4
Converted name: test.ts.mp4
What I'd like: test.mp4
Currently my script:
- Code: Select all
/usr/local/bin/HandbrakeCLI -i "$1" -o "${1%avi}".mp4 -e x264 -b 3000 --optimize -w 720 -l 404
I'd be happy to create a rule that could rename the file after this if no one can help me with the script, but I can't figure out that either.
Thanks all!