Align queued DVD jobs with direct convert settings
This commit is contained in:
parent
a6721080c5
commit
453d6280ed
34
main.go
34
main.go
|
|
@ -814,9 +814,33 @@ func (s *appState) executeConvertJob(ctx context.Context, job *queue.Job, progre
|
||||||
"-y",
|
"-y",
|
||||||
"-hide_banner",
|
"-hide_banner",
|
||||||
"-loglevel", "error",
|
"-loglevel", "error",
|
||||||
"-i", inputPath,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if this is a DVD format (special handling required)
|
||||||
|
selectedFormat, _ := cfg["selectedFormat"].(formatOption)
|
||||||
|
isDVD := selectedFormat.Ext == ".mpg"
|
||||||
|
|
||||||
|
// DVD presets: enforce compliant target, frame rate, resolution, codecs
|
||||||
|
if isDVD {
|
||||||
|
if strings.Contains(selectedFormat.Label, "PAL") {
|
||||||
|
args = append(args, "-target", "pal-dvd")
|
||||||
|
cfg["frameRate"] = "25"
|
||||||
|
cfg["targetResolution"] = "PAL (720×576)"
|
||||||
|
} else {
|
||||||
|
args = append(args, "-target", "ntsc-dvd")
|
||||||
|
cfg["frameRate"] = "29.97"
|
||||||
|
cfg["targetResolution"] = "NTSC (720×480)"
|
||||||
|
}
|
||||||
|
cfg["videoCodec"] = "MPEG-2"
|
||||||
|
cfg["audioCodec"] = "AC-3"
|
||||||
|
if _, ok := cfg["audioBitrate"].(string); !ok || cfg["audioBitrate"] == "" {
|
||||||
|
cfg["audioBitrate"] = "192k"
|
||||||
|
}
|
||||||
|
cfg["pixelFormat"] = "yuv420p"
|
||||||
|
}
|
||||||
|
|
||||||
|
args = append(args, "-i", inputPath)
|
||||||
|
|
||||||
// Add cover art if available
|
// Add cover art if available
|
||||||
coverArtPath, _ := cfg["coverArtPath"].(string)
|
coverArtPath, _ := cfg["coverArtPath"].(string)
|
||||||
hasCoverArt := coverArtPath != ""
|
hasCoverArt := coverArtPath != ""
|
||||||
|
|
@ -890,10 +914,6 @@ func (s *appState) executeConvertJob(ctx context.Context, job *queue.Job, progre
|
||||||
args = append(args, "-vf", strings.Join(vf, ","))
|
args = append(args, "-vf", strings.Join(vf, ","))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if this is a DVD format (special handling required)
|
|
||||||
selectedFormat, _ := cfg["selectedFormat"].(formatOption)
|
|
||||||
isDVD := selectedFormat.Ext == ".mpg"
|
|
||||||
|
|
||||||
// Video codec
|
// Video codec
|
||||||
videoCodec, _ := cfg["videoCodec"].(string)
|
videoCodec, _ := cfg["videoCodec"].(string)
|
||||||
if videoCodec == "Copy" && !isDVD {
|
if videoCodec == "Copy" && !isDVD {
|
||||||
|
|
@ -3354,6 +3374,8 @@ func determineVideoCodec(cfg convertConfig) string {
|
||||||
return "libaom-av1"
|
return "libaom-av1"
|
||||||
case "MPEG-2":
|
case "MPEG-2":
|
||||||
return "mpeg2video"
|
return "mpeg2video"
|
||||||
|
case "mpeg2video":
|
||||||
|
return "mpeg2video"
|
||||||
case "Copy":
|
case "Copy":
|
||||||
return "copy"
|
return "copy"
|
||||||
default:
|
default:
|
||||||
|
|
@ -3372,6 +3394,8 @@ func determineAudioCodec(cfg convertConfig) string {
|
||||||
return "libmp3lame"
|
return "libmp3lame"
|
||||||
case "AC-3":
|
case "AC-3":
|
||||||
return "ac3"
|
return "ac3"
|
||||||
|
case "ac3":
|
||||||
|
return "ac3"
|
||||||
case "FLAC":
|
case "FLAC":
|
||||||
return "flac"
|
return "flac"
|
||||||
case "Copy":
|
case "Copy":
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user