Page 1 of 1

HandBrakeCLI batch conversion.

Posted: 2018/02/12 01:06:52
by supertight
I want handbrake to convert all the .mkv in a folder to .mp4

Code: Select all

HandBrakeCLI -v -i "./${file}" -o "./${file%.mkv}.mp4" -e x264
Handbrake starts, creates 1 file named .mp4 and exits. I don't get it.

I know this is easy, I'm just not seeing the hold up.

Re: HandBrakeCLI batch conversion.

Posted: 2018/02/12 02:03:28
by TrevorH
You appear to have pinched the bash code out of someone's for loop and neglected to copy the for loop itself. You need to wrap that inside something that sets ${file} to something. e.g.

for file in *.mkv;do HandBrakeCLI -v -i "./${file}" -o "./${file%.mkv}.mp4" -e x264;done

Re: HandBrakeCLI batch conversion.

Posted: 2018/02/12 03:09:56
by supertight
TrevorH wrote:You appear to have pinched the bash code out of someone's for loop and neglected to copy the for loop itself. You need to wrap that inside something that sets ${file} to something. e.g.

for file in *.mkv;do HandBrakeCLI -v -i "./${file}" -o "./${file%.mkv}.mp4" -e x264;done
I added the wrapper as suggested. Same outcome. Makes 1 file ".mp4"

Re: HandBrakeCLI batch conversion.

Posted: 2018/02/12 03:16:01
by supertight
supertight wrote:
TrevorH wrote:You appear to have pinched the bash code out of someone's for loop and neglected to copy the for loop itself. You need to wrap that inside something that sets ${file} to something. e.g.

for file in *.mkv;do HandBrakeCLI -v -i "./${file}" -o "./${file%.mkv}.mp4" -e x264;done
I added the wrapper as suggested. Same outcome. Makes 1 file ".mp4"
Negative. I made a typo. This worked perfect.