Skip to content

Conversation

@sr55
Copy link
Contributor

@sr55 sr55 commented Jan 30, 2024

Description

New Subtitle Rules Panel (#1860)

This provides a more flexible set of options for automatically adding subtitle tracks when importing a source into HandBrake.

Would appreciate some feedback on the UX of the new panel design.

I've dropped the Add CC when available option. it seems redundant.

Preset Format Changes:

The new preset format is as follows:

We can probably migrate the format forward to a limited degree when the mac and linux Ui's update as well.

        "SubtitleBehaviours": [
            {
              "IsoLangCode": "eng",
              "TrackSelectionMode": 0,
              "DefaultMode": 0,
              "BurnPassthruMode": 0,
              "ForcedMode": 0,
              "TrackNameOverride": "Test",
              "IsForeignAudioScanRule": 1
            },
            {
              "IsoLangCode": "fra",
              "TrackSelectionMode": 1,
              "DefaultMode": 1,
              "BurnPassthruMode": 1,
              "ForcedMode": 0,
              "TrackNameOverride": "Test 2",
              "IsForeignAudioScanRule": 0
            },
            {
              "IsoLangCode": "deu",
              "TrackSelectionMode": 0,
              "DefaultMode": 0,
              "BurnPassthruMode": 2,
              "ForcedMode": 0,
              "TrackNameOverride": "Test 3",
              "IsForeignAudioScanRule": 0
            }
          ],
          "SubtitleUseSourceOrder": true,
          "SubtitleImportMode": 0,
          "SubtitlePassthruTrackNames": true,
Field Type Values
IsoLangCode string Iso639 code or "foreign"
TrackSelectionMode Int 0 = First Match, 1 = All Matching
DefaultMode Int 0 = No, 1 = Yes
BurnPassthruMode Int 0 = PassthruDrop, 1= PassthruBurnDrop, 2= BurnDrop
ForcedMode Int 0 = No, 1 = Yes
IsForeignAudioScanRule Int 0 = No, 1 = Yes
SubtitleImportMode int 0 = None, 1 = Before Process Rule Tracks, 2 = After Processed Rule Tracks

Removed Preset Keys

Field Type Notes
SubtitleAddCC bool Appears Redundant.
SubtitleAddForeignAudioSearch bool Covered by IsForeignAudioScanRule in the subtitle tracks
SubtitleAddForeignAudioSubtitle bool Never Used by Win GUI
SubtitleBurnBehavior string Replaced by SubtitleBehaviour
SubtitleBurnBDSub bool Never Used by Win GUI
SubtitleLanguageList list Replaced by SubtitleBehaviours
SubtitleTrackSelectionBehavior string Replaced by SubtitleBehaviours

File Loading Notes

When an import mode is selected, any file that has the extension .srt or .ssa that also contains the source filename (case insensitive) will be imported.

We try to guess the language of the file by:

  • Checking if the file contains the english or native name.
  • Checking if it contains an iso code i.e ".eng." (Note the "."'s. These are to help avoid false positives by using this common convention in the filenames.

Screenshots

image

Command Line

I think we leave it as-is. Trying to implement advanced options as CLI params is pretty ugly. Where users are using a preset, they'd gain the more complex behaviour by virtue of the shared preset code I believe.

TODO

  1. presets.c needs updated with new logic.
  2. macOS GUI needs updated
  3. Linux GUI needs updated
  4. Decide what to do with HandBrakeCLI.exe

@sr55 sr55 added this to the 1.8.0 milestone Jan 30, 2024
@sr55 sr55 changed the title Sub overhaul Sub Overhaul Prototype Jan 30, 2024
@sr55
Copy link
Contributor Author

sr55 commented Feb 23, 2024

The base functionality / UX is now all in place. Feedback welcome.

@sr55 sr55 modified the milestones: 1.8.0, 1.9.0 Apr 19, 2024
@sr55 sr55 mentioned this pull request May 23, 2024
@sr55
Copy link
Contributor Author

sr55 commented May 27, 2024

Rebased

@sr55
Copy link
Contributor Author

sr55 commented Jun 8, 2024

Rebased.

@sr55 sr55 removed this from the 1.9.0 milestone Nov 23, 2024
@sr55 sr55 force-pushed the SubOverhaul branch 2 times, most recently from 242caf2 to 535e583 Compare December 9, 2024 20:36
@sr55 sr55 added this to the 1.10.0 milestone Dec 9, 2024
@sr55 sr55 changed the title Sub Overhaul Prototype Subtitle Behaviours Overhaul Dec 9, 2024
@sr55 sr55 self-assigned this Dec 9, 2024
@sr55
Copy link
Contributor Author

sr55 commented Dec 9, 2024

@galad87 @bradleysepos @jstebbins

Any feedback from you would be good?

@galad87
Copy link
Contributor

galad87 commented Dec 10, 2024

Is there still a "Any" language to apply a rule to all languages?

@sr55
Copy link
Contributor Author

sr55 commented Dec 10, 2024

Is there still a "Any" language to apply a rule to all languages?

Yup. Any and Unknown are still in the list.

@sr55
Copy link
Contributor Author

sr55 commented Jul 24, 2025

Closing in favour of #7063

This cleans up the history and rebases it onto main

@sr55 sr55 closed this Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants