converting large library to HEVC

Discussion of the HandBrake command line interface (CLI)
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.
Post Reply
lvving
Posts: 7
Joined: Thu Mar 14, 2019 5:19 am

converting large library to HEVC

Post by lvving »

Description of problem or question:
I'm looking for a way to convert a large library consisting of mostly MKV and MP4 in x264 format. Some of the MKV have multiple audio tracks and/or chapters and/or subtitles. I would like to only convert the video to HEVC but keep everything else the exact same including multiple audio tracks if they exist and multiple subtitles if they exist.
The part I can't figure out is how to have all of the audio tracks, if there is more than one, copied. Right now, I can only seem to have the first track copied. I don't really care about non-English tracks but some of the MKVs have both AC3 and/or DTS and/or Dolby Atmos and I would like to leave them all untouched. I did create a profile and I am pointing to it via my CLI but it seems to ignore any audio track past the first it encounters. I'm hoping someone can whip up a simple CLI way to do this. I can't seem to get it right.

HandBrake version (e.g., 1.0.0):
Using the 1.2.2 CLI version.

Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Windows 2012
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: converting large library to HEVC

Post by Woodstock »

You can specify a range of audio tracks, and can specify "copy" as the encoder. As long as your source tracks use codecs that are allowed for "passthru" to your destination container.
lvving
Posts: 7
Joined: Thu Mar 14, 2019 5:19 am

Re: converting large library to HEVC

Post by lvving »

This is what I just started using and it seems to be working so far. I found another post in a different forum of someone trying to do something similar.
HandBrakeCLI.exe -i <input file> -e x265 --encoder-preset medium --encoder-profile main -x strong-intra-smoothing=0:rect=0 -q 20 --all-audio --audio-lang-list eng --all-subtitles --subtitle-lang-list eng -E copy -o <output file>
vincen
Posts: 1
Joined: Fri Nov 30, 2018 9:32 am

Re: converting large library to HEVC

Post by vincen »

lvving wrote: Thu Mar 14, 2019 2:19 pm This is what I just started using and it seems to be working so far. I found another post in a different forum of someone trying to do something similar.
Would you mind to share your process for doing your large batch conversions ? as I'm in similar situation with a very large video library and lot of mix of formats and to save space (whatever time it takes to convert as I have a lot of power avalaible on server where they are hosted) I'd like to convert everything in H265 ;)

Thanks
lvving
Posts: 7
Joined: Thu Mar 14, 2019 5:19 am

Re: converting large library to HEVC

Post by lvving »

vincen wrote: Sat Mar 23, 2019 4:49 pm
lvving wrote: Thu Mar 14, 2019 2:19 pm This is what I just started using and it seems to be working so far. I found another post in a different forum of someone trying to do something similar.
Would you mind to share your process for doing your large batch conversions ? as I'm in similar situation with a very large video library and lot of mix of formats and to save space (whatever time it takes to convert as I have a lot of power avalaible on server where they are hosted) I'd like to convert everything in H265 ;)

Thanks
I converted almost all of my MKV movies to H265 using FFMPEG. There were a few that FFMPEG wasn't able to that I did with handbrake CLI instead. The FFMPEG command I used was:
ffmpeg -n -stats -i "input.mkv" -map 0:v -map 0:a -c:v hevc -crf 20 -c:a copy -c:s copy -threads 4 "output.mkv"

The handbrake cli command I used was:
HandBrakeCLI.exe -i "input.mkv" -e x265 --encoder-preset medium --encoder-profile main -x strong-intra-smoothing=0:rect=0 -q 20 --all-audio --audio-lang-list eng --all-subtitles --subtitle-lang-list eng -E copy -o "output.mkv"

FWIW, FFMPEG seems to be significantly faster.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: converting large library to HEVC

Post by mduell »

Different settings will get you different speeds.
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: converting large library to HEVC

Post by s55 »

significantly different at that. HandBrakeCLI has default settings that your not accounting for.
Post Reply