Ensure upscale targets recompute from presets
This commit is contained in:
parent
4c43a13f9c
commit
c6feb239b9
1
DONE.md
1
DONE.md
|
|
@ -804,6 +804,7 @@ This file tracks completed features, fixes, and milestones.
|
|||
- ✅ Defaulted Target Aspect Ratio back to Source unless user explicitly sets it
|
||||
- ✅ Synced Target Aspect Ratio between Simple and Advanced menus
|
||||
- ✅ Hide manual CRF input when Lossless quality is selected
|
||||
- ✅ Upscale now recomputes target dimensions from the preset to ensure 2X/4X apply
|
||||
- ✅ Stabilized video seeking and embedded rendering
|
||||
- ✅ Improved player window positioning
|
||||
- ✅ Fixed clear video functionality
|
||||
|
|
|
|||
1
TODO.md
1
TODO.md
|
|
@ -49,6 +49,7 @@ This file tracks upcoming features, improvements, and known issues.
|
|||
- Target aspect default enforced as Source unless user changes it
|
||||
- Target aspect sync across simple/advanced menus
|
||||
- Hide manual CRF entry when Lossless quality is active
|
||||
- Upscale target dimensions recomputed from preset for 2X/4X reliability
|
||||
|
||||
## Priority Features for dev20+
|
||||
|
||||
|
|
|
|||
22
main.go
22
main.go
|
|
@ -4322,6 +4322,9 @@ func (s *appState) executeUpscaleJob(ctx context.Context, job *queue.Job, progre
|
|||
method := cfg["method"].(string)
|
||||
targetWidth := int(cfg["targetWidth"].(float64))
|
||||
targetHeight := int(cfg["targetHeight"].(float64))
|
||||
targetPreset, _ := cfg["targetPreset"].(string)
|
||||
sourceWidth := int(toFloat(cfg["sourceWidth"]))
|
||||
sourceHeight := int(toFloat(cfg["sourceHeight"]))
|
||||
preserveAR := true
|
||||
if v, ok := cfg["preserveAR"].(bool); ok {
|
||||
preserveAR = v
|
||||
|
|
@ -4335,6 +4338,21 @@ func (s *appState) executeUpscaleJob(ctx context.Context, job *queue.Job, progre
|
|||
progressCallback(0)
|
||||
}
|
||||
|
||||
// Recompute target dimensions from preset to avoid stale values
|
||||
if targetPreset != "" && targetPreset != "Custom" {
|
||||
if sourceWidth <= 0 || sourceHeight <= 0 {
|
||||
if src, err := probeVideo(inputPath); err == nil && src != nil {
|
||||
sourceWidth = src.Width
|
||||
sourceHeight = src.Height
|
||||
}
|
||||
}
|
||||
if w, h, keepAR, err := parseResolutionPreset(targetPreset, sourceWidth, sourceHeight); err == nil {
|
||||
targetWidth = w
|
||||
targetHeight = h
|
||||
preserveAR = keepAR
|
||||
}
|
||||
}
|
||||
|
||||
// Build filter chain
|
||||
var filters []string
|
||||
|
||||
|
|
@ -4351,6 +4369,7 @@ func (s *appState) executeUpscaleJob(ctx context.Context, job *queue.Job, progre
|
|||
|
||||
// Add scale filter (preserve aspect by default)
|
||||
scaleFilter := buildUpscaleFilter(targetWidth, targetHeight, method, preserveAR)
|
||||
logging.Debug(logging.CatFFMPEG, "upscale: target=%dx%d preserveAR=%v method=%s filter=%s", targetWidth, targetHeight, preserveAR, method, scaleFilter)
|
||||
filters = append(filters, scaleFilter)
|
||||
|
||||
// Add frame rate conversion if requested
|
||||
|
|
@ -12618,6 +12637,9 @@ func buildUpscaleView(state *appState) fyne.CanvasObject {
|
|||
"method": state.upscaleMethod,
|
||||
"targetWidth": float64(targetWidth),
|
||||
"targetHeight": float64(targetHeight),
|
||||
"targetPreset": state.upscaleTargetRes,
|
||||
"sourceWidth": float64(state.upscaleFile.Width),
|
||||
"sourceHeight": float64(state.upscaleFile.Height),
|
||||
"preserveAR": preserveAspect,
|
||||
"useAI": state.upscaleAIEnabled && state.upscaleAIAvailable,
|
||||
"aiModel": state.upscaleAIModel,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user