Normalize bitrate preset default to 2.5 Mbps

This commit is contained in:
Stu Leak 2025-12-20 16:07:13 -05:00
parent 3354017032
commit 17900f2b0a
3 changed files with 29 additions and 1 deletions

View File

@ -828,6 +828,7 @@ This file tracks completed features, fixes, and milestones.
- ✅ Removed CRF visibility toggle from quality updates to prevent CBR/VBR bleed-through
- ✅ Added CRF preset dropdown with Manual option
- ✅ Added 0.5/1.0 Mbps bitrate presets and simplified preset names
- ✅ Default bitrate preset normalized to 2.5 Mbps to avoid "select one"
- ✅ Stabilized video seeking and embedded rendering
- ✅ Improved player window positioning
- ✅ Fixed clear video functionality

View File

@ -61,6 +61,7 @@ This file tracks upcoming features, improvements, and known issues.
- CRF visibility no longer overridden by quality updates
- CRF preset dropdown added with Manual option
- Bitrate presets expanded to include 0.5/1.0 Mbps and renamed for clarity
- Default bitrate preset normalized to 2.5 Mbps to prevent empty select
*Last Updated: 2025-12-20*

28
main.go
View File

@ -6091,6 +6091,31 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
bitratePresetLabels = append(bitratePresetLabels, p.Label)
}
normalizePresetLabel := func(label string) string {
switch label {
case "2.5 Mbps - Medium Quality":
return "2.5 Mbps - Medium"
case "2.0 Mbps - Medium-Low Quality":
return "2.0 Mbps - Medium-Low"
case "1.5 Mbps - Low Quality":
return "1.5 Mbps - Low"
case "4.0 Mbps - Good Quality":
return "4.0 Mbps - Good"
case "6.0 Mbps - High Quality":
return "6.0 Mbps - High"
case "8.0 Mbps - Very High Quality":
return "8.0 Mbps - Very High"
case "0.5 Mbps - Ultra Low":
return label
case "1.0 Mbps - Very Low":
return label
case "Manual":
return "Manual"
default:
return label
}
}
var applyBitratePreset func(string)
bitratePresetSelect = widget.NewSelect(bitratePresetLabels, func(value string) {
@ -6098,8 +6123,9 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
applyBitratePreset(value)
}
})
state.convert.BitratePreset = normalizePresetLabel(state.convert.BitratePreset)
if state.convert.BitratePreset == "" || bitratePresetLookup[state.convert.BitratePreset].Label == "" {
state.convert.BitratePreset = "2.5 Mbps - Medium Quality"
state.convert.BitratePreset = "2.5 Mbps - Medium"
}
bitratePresetSelect.SetSelected(state.convert.BitratePreset)