Adding subtitles to a Preset in CLI

Discuss encoding for devices and presets.
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
SpaceAvenger
Posts: 3
Joined: Wed Apr 03, 2019 6:53 pm

Adding subtitles to a Preset in CLI

Post by SpaceAvenger »

Description of problem or question:
I've been running this script for a number of years successfully. The only issue is some shows have sections where a different language is spoken and subtitles are shown during this time. I'd like to be able to just add these subtitles without messing with the preset video/audio settings. Is there a way to do this?

for filename in $(cat /var/HandBrakeScript/Moviesprocessed); do
echo "$filename"

HandBrakeCLI -i "$filename" -o "${filename%.*}".mp4 --preset="Super HQ 720p30 Surround"

rm -r "$filename"

done

Steps to reproduce the problem (If Applicable):




HandBrake version (e.g., 1.0.0):
1.2.2



Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Ubuntu Server 18.04



HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

Please replace this text with the contents of your log file between the two code tags - OR -  provide a pastebin URL in place of these 3 lines.
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Adding subtitles to a Preset in CLI

Post by Woodstock »

--subtitle 1-99

Will add all available subtitles (all being 99 or fewer).

If you want handbrake to do an extra pass to see if it can find the "foreign language" subtitles:

--subtitle scan --subtitle-forced
SpaceAvenger
Posts: 3
Joined: Wed Apr 03, 2019 6:53 pm

Re: Adding subtitles to a Preset in CLI

Post by SpaceAvenger »

Argg... I swear I tried adding --subtitle # at the end of the line but it didn't work. Tried it again today and now it does. Thank you for your time and help on this. I figured it was a simple fix and, like I said, I attempted adding that setting before but perhaps I made a syntax or spelling error.
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Adding subtitles to a Preset in CLI

Post by Woodstock »

You might have done what I did when I first posted the reply... put an S at the end of --subtitle ... :roll:
SpaceAvenger
Posts: 3
Joined: Wed Apr 03, 2019 6:53 pm

Re: Adding subtitles to a Preset in CLI

Post by SpaceAvenger »

Quite possible. Wouldn't have been the first time a single character threw me for a long loop. I'm no expert but I'm also not a newb at this sort of stuff. When I figure it out it just makes me want to slam my head in a door. LOL
Post Reply