You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add ability to remove forced subtitles from a subtitle stream #1492
When I encode a movie that has foreign language forced subtitles, I normally burn the foreign language forced subtitles into the video (using something like --subtitle 2,2 --subtitle-forced=1 --subtitle-burned=1) so that they will show up even on players that do not support soft subtitles.
When the track that contains the forced subtitles also contains non-forced subtitles, I usually want to keep those as a separate soft subtitle track. So in the example given above, the first subtitle track would find the forced subtitles and burn them in, and then also include track 2 as a soft subtitle track so that players that support soft subtitles can use it.
Because different players often place soft subtitles on the video somewhat differently than Handbrake does, when the soft subtitles are enabled (to get the full subtitle track) you end up with two copies of the forced subtitles on the video, often offset and overlapping which makes them ugly and hard to read.
There should be an option to get the inverse of --subtitle-forced, that is to say, to only keep subtitles in a track that are not forced. Example: --subtitle 2,2 --subtitle-forced=1 --subtitle-non-forced=2 --subtitle-burned=1 which would exclude any forced subtitles from the soft subtitle track, so that when it is enabled, it will not add a second copy of the forced subtitles that are already burned into the video.
This new option should allow a list of subtitle tracks, just like the --subtitle-forced option does.
I'm currently using HandBrakeCLI 1.1.0 on Debian stretch and OS X.
Your suggestion pre-supposes that the track contains subtitles that are flagged as "forced", as well as unflagged subtitles. This is not the predominant case.
A general solution to this would require the ability to do a "diff" between two subtitle tracks, and write a third track.
Yes, this feature only covers the case where the same track contains both forced and non-forced subtitles. I kept this feature request very narrow because all of the functionality to discriminate inclusion already exists within handbrake, this would be a very simple change to allow inverting the test.
And you are right that a more general solution that handled some way of doing a diff between tracks would be preferable. I considered asking for a diff-like functionality, but that seems like a MUCH harder and also much more unreliable problem to solve. And also one where the developers would just say "Not going to do it, if you want that level of control, re-author and re-mux the subtitle track yourself".
However I did think about what it might take to try to have some sort of more general solution within Handbrake. With considerations like bitmap subtitles with different positioning or layout or colors, language and translation differences, and others, I think it's pretty unlikely that a reliable general purpose cross-subtitle-track diff functionality could be developed.
The most likely-to-work method I can think of is one based simply on visible time (with a fudge factor to handle small timing differences between tracks), where if the subtitle track that is designated for inclusion has a subtitle that is visible, any other subtitle tracks that it is being diff'd against would have their subtitles suppressed until the primary track is no longer visible. But due to the timing and appearance of different specific subtitles in different tracks, this still isn't that clean of a solution, as there are lots of edge cases that would need to be handled like when subtitles between tracks overlap in time in different ways.
Thanks for the suggestion. I'll make this as an enhancement. This sounds like a pretty niche use-case so it may not be something we do but I'm leaving it open for further discussion for now.
I've found a few DVDs (quite a few anime, but also things like The Terminator) which have a single subtitle track with mixed forced, and non-forced subtitles. In anime it's often things like signs/writing in Japanese which has an overlay. Most anime does separate out the overlay track from the primary English subtitles though.
Unbelievably in The Terminator it's text which is telling the story of the movie (in the intro it shows robots fighting humans and overlays information about the robot vs human war).
I might actually have a bash at trying to implement this, although c++ is not my usual wheelhouse.
Activity
woodstockathbf commentedon Jul 20, 2018
Your suggestion pre-supposes that the track contains subtitles that are flagged as "forced", as well as unflagged subtitles. This is not the predominant case.
A general solution to this would require the ability to do a "diff" between two subtitle tracks, and write a third track.
domihb commentedon Jul 20, 2018
Yes, this feature only covers the case where the same track contains both forced and non-forced subtitles. I kept this feature request very narrow because all of the functionality to discriminate inclusion already exists within handbrake, this would be a very simple change to allow inverting the test.
And you are right that a more general solution that handled some way of doing a diff between tracks would be preferable. I considered asking for a diff-like functionality, but that seems like a MUCH harder and also much more unreliable problem to solve. And also one where the developers would just say "Not going to do it, if you want that level of control, re-author and re-mux the subtitle track yourself".
However I did think about what it might take to try to have some sort of more general solution within Handbrake. With considerations like bitmap subtitles with different positioning or layout or colors, language and translation differences, and others, I think it's pretty unlikely that a reliable general purpose cross-subtitle-track diff functionality could be developed.
The most likely-to-work method I can think of is one based simply on visible time (with a fudge factor to handle small timing differences between tracks), where if the subtitle track that is designated for inclusion has a subtitle that is visible, any other subtitle tracks that it is being diff'd against would have their subtitles suppressed until the primary track is no longer visible. But due to the timing and appearance of different specific subtitles in different tracks, this still isn't that clean of a solution, as there are lots of edge cases that would need to be handled like when subtitles between tracks overlap in time in different ways.
sr55 commentedon Aug 1, 2018
Thanks for the suggestion. I'll make this as an enhancement. This sounds like a pretty niche use-case so it may not be something we do but I'm leaving it open for further discussion for now.
jfharden commentedon Apr 25, 2021
I've found a few DVDs (quite a few anime, but also things like The Terminator) which have a single subtitle track with mixed forced, and non-forced subtitles. In anime it's often things like signs/writing in Japanese which has an overlay. Most anime does separate out the overlay track from the primary English subtitles though.
Unbelievably in The Terminator it's text which is telling the story of the movie (in the intro it shows robots fighting humans and overlays information about the robot vs human war).
I might actually have a bash at trying to implement this, although c++ is not my usual wheelhouse.
Perhaps a
--no-subtitle-forcedso you could runThis would burn in the forced subtitles and remove them from the separate subtitle stream.
jfharden commentedon Apr 25, 2021
Now I've seen it written down perhaps
--subtitle-no-forcedwould be bettern8klayko commentedon Feb 5, 2022
I would like to second this request. This is somethin I find very useful too