Trouble handling audio tracks in handbrakeCLI

131 views Asked by At

First time using handbrakeCLI. I am currently testing this script to encode videos (for cropping purposes), I have set it to handle all audio tracks; to copy all but aac,ac3,mp2,mp3,opus and to encode all others with opus to 160kbps.

Every single video I encode has no audio whatsoever. All of the tested ~20 videos had a single AAC audio track, which was not copied over. I first tried using --all-audio but I received error claiming it cannot be used with --audio, which was not even used at the time.

HandBrakeCLI.exe -i %1 -o "%new%" --encoder x265_10bit --encoder-preset slow --encoder-profile main444-10 --vb %bitrate% --two-pass --turbo --audio 1,2,3,4,5,6,7,8,9 --aencoder copy --audio-copy-mask aac,ac3,mp2,mp3,opus --audio-fallback opus -ab 160 --drc 2.0 --crop-mode conservative

It is important, whenever possible, to make the audio more apartment bulding night time watching friendly (whatever the term might be), hence the --drc 2.0, though I'm not sure where its applicable.

1

There are 1 answers

1
Vineesh Vijayan On

The issue might be with the order of your HandBrakeCLI command arguments. Try modifying your command as follows:

HandBrakeCLI.exe -i %1 -o "%new%" --encoder x265_10bit --encoder-preset slow --encoder-profile main444-10 --vb %bitrate% --two-pass --turbo --aencoder copy --audio 1,2,3,4,5,6,7,8,9 --audio-copy-mask aac,ac3,mp2,mp3,opus --audio-fallback opus -ab 160 --drc 2.0 --crop-mode conservative

Here are the changes made to the command:

The --aencoder copy flag is moved before the --audio flag. This ensures that the audio tracks are copied before applying any filters or encoding settings.

The --audio-copy-mask and --audio-fallback flags remain as they were, specifying which audio formats to copy and which format to fallback to if the original format is not supported.