How can I batch convert files in a directory, using a custom preset and preserving the structure of any sub-directories?
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
-
- Posts: 2
- Joined: Sat Jun 24, 2017 2:25 pm
How can I batch convert files in a directory, using a custom preset and preserving the structure of any sub-directories?
I'm using v1.0.7 and have HandbrakeCLI installed on MacOS Sierra. I would like to batch convert videos in a source directory whilst recursively preserving the names and structure of any sub-directories those videos might be in. I would also like to use my own custom preset. I understand that Handbrake is unable to do this via the GUI, but can it be done via the CLI? I attempted to modify SurlyJake's script for batch conversion, but just made a mess of it :/
Re: How can I batch convert files in a directory, using a custom preset and preserving the structure of any sub-director
You could do this with a short shell script wrapping the CLI (i.e. calling the CLI for each video it finds).
-
- New User
- Posts: 1
- Joined: Sat Oct 07, 2017 2:35 pm
Re: How can I batch convert files in a directory, using a custom preset and preserving the structure of any sub-director
Are there any sample scripts for this?
Re: How can I batch convert files in a directory, using a custom preset and preserving the structure of any sub-director
Today morning I needed to convert about 200 files in a directory, below is how I did it. I hope it gets you started.
Code: Select all
for i in *.mkv ;
do HandBrakeCLI -i "$i" -g --nlmeans=light --nlmeans-tune film -f av_mkv -e x265 -q 22 --vfr -E opus -B 64 -o "new/${i%mkv}mkv" ;
done
-
- Posts: 2
- Joined: Sat Jun 24, 2017 2:25 pm
Re: How can I batch convert files in a directory, using a custom preset and preserving the structure of any sub-director
Presumably that's for 200 files in one directory, isn't it? Not 200 files in 200 (or whatever) sub-directories?Segfault wrote: ↑Sun Oct 08, 2017 7:19 pm Today morning I needed to convert about 200 files in a directory, below is how I did it. I hope it gets you started.Code: Select all
for i in *.mkv ; do HandBrakeCLI -i "$i" -g --nlmeans=light --nlmeans-tune film -f av_mkv -e x265 -q 22 --vfr -E opus -B 64 -o "new/${i%mkv}mkv" ; done