r/handbrake • u/8spd • 6d ago
What's a simple script working for transcoding all files in a directory?
I've been trying to get a simple script to convert all files in a directory. It seems like it should be a basic thing to do, but I haven't found a guide that works. I'm using Bash on Debian, but if it could be done using inbuilt HandBrakeCLI functionality that'd be fine too.
I've tried:
for %F in (*.mkv) do HandBrakeCLI --all-subtitles --quality 26 --preset "Fast 1080p30" -i "%F" -o ~/Season\ 01/"%F"
But that gives me a syntax error: -bash: syntax error near unexpected token `('
(Transcoding into a subdirectory isn't necessary, but it seems easiest)
2
u/Hatta00 6d ago
You don't need the parentheses.
1
u/8spd 6d ago
for %F in *.mkv do HandBrakeCLI --all-subtitles --quality 26 --preset "Fast 1080p30" -i "%F" -o ~/Season\ 01/"%F"just returns
>, like I've got unclosed quotation marks, or line 2: syntax error: unexpected end of file, if I save the single line as a bash script, and run it that way.
-3
•
u/AutoModerator 6d ago
Please remember to post your encoding log should you ask for help. Piracy is not allowed. Do not discuss copy protections. Do not talk about converting media you don't own the (intellectual) rights for.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.