Add enhanced logging for DVD authoring pipeline
- Log all generated MPG files with sizes before dvdauthor - Log complete DVD XML content for debugging - Add specific error messages at each dvdauthor step - Verify and log ISO file creation success - Better error context for diagnosing 80% failure point This will help diagnose the exit code 1 error when authoring 4-scene discs to ISO format.
This commit is contained in:
parent
95d8541866
commit
0fce3f7aa1
|
|
@ -1766,15 +1766,34 @@ func (s *appState) runAuthoringPipeline(ctx context.Context, paths []string, reg
|
||||||
chapters = nil
|
chapters = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Log details about encoded MPG files
|
||||||
|
if logFn != nil {
|
||||||
|
logFn(fmt.Sprintf("Created %d MPEG file(s):", len(mpgPaths)))
|
||||||
|
for i, mpg := range mpgPaths {
|
||||||
|
if info, err := os.Stat(mpg); err == nil {
|
||||||
|
logFn(fmt.Sprintf(" %d. %s (%d bytes)", i+1, filepath.Base(mpg), info.Size()))
|
||||||
|
} else {
|
||||||
|
logFn(fmt.Sprintf(" %d. %s (stat failed: %v)", i+1, filepath.Base(mpg), err))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
xmlPath := filepath.Join(workDir, "dvd.xml")
|
xmlPath := filepath.Join(workDir, "dvd.xml")
|
||||||
if err := writeDVDAuthorXML(xmlPath, mpgPaths, region, aspect, chapters); err != nil {
|
if err := writeDVDAuthorXML(xmlPath, mpgPaths, region, aspect, chapters); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Log the XML content for debugging
|
||||||
|
if xmlContent, err := os.ReadFile(xmlPath); err == nil {
|
||||||
|
logFn("Generated DVD XML:")
|
||||||
|
logFn(string(xmlContent))
|
||||||
|
}
|
||||||
|
|
||||||
logFn("Authoring DVD structure...")
|
logFn("Authoring DVD structure...")
|
||||||
logFn(fmt.Sprintf(">> dvdauthor -o %s -x %s", discRoot, xmlPath))
|
logFn(fmt.Sprintf(">> dvdauthor -o %s -x %s", discRoot, xmlPath))
|
||||||
if err := runCommandWithLogger(ctx, "dvdauthor", []string{"-o", discRoot, "-x", xmlPath}, logFn); err != nil {
|
if err := runCommandWithLogger(ctx, "dvdauthor", []string{"-o", discRoot, "-x", xmlPath}, logFn); err != nil {
|
||||||
return err
|
logFn(fmt.Sprintf("ERROR: dvdauthor failed: %v", err))
|
||||||
|
return fmt.Errorf("dvdauthor structure creation failed: %w", err)
|
||||||
}
|
}
|
||||||
accumulatedProgress += progressForOtherStep
|
accumulatedProgress += progressForOtherStep
|
||||||
progressFn(accumulatedProgress)
|
progressFn(accumulatedProgress)
|
||||||
|
|
@ -1782,7 +1801,8 @@ func (s *appState) runAuthoringPipeline(ctx context.Context, paths []string, reg
|
||||||
logFn("Building DVD tables...")
|
logFn("Building DVD tables...")
|
||||||
logFn(fmt.Sprintf(">> dvdauthor -o %s -T", discRoot))
|
logFn(fmt.Sprintf(">> dvdauthor -o %s -T", discRoot))
|
||||||
if err := runCommandWithLogger(ctx, "dvdauthor", []string{"-o", discRoot, "-T"}, logFn); err != nil {
|
if err := runCommandWithLogger(ctx, "dvdauthor", []string{"-o", discRoot, "-T"}, logFn); err != nil {
|
||||||
return err
|
logFn(fmt.Sprintf("ERROR: dvdauthor -T failed: %v", err))
|
||||||
|
return fmt.Errorf("dvdauthor table build failed: %w", err)
|
||||||
}
|
}
|
||||||
accumulatedProgress += progressForOtherStep
|
accumulatedProgress += progressForOtherStep
|
||||||
progressFn(accumulatedProgress)
|
progressFn(accumulatedProgress)
|
||||||
|
|
@ -1794,15 +1814,24 @@ func (s *appState) runAuthoringPipeline(ctx context.Context, paths []string, reg
|
||||||
if makeISO {
|
if makeISO {
|
||||||
tool, args, err := buildISOCommand(outputPath, discRoot, title)
|
tool, args, err := buildISOCommand(outputPath, discRoot, title)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
logFn(fmt.Sprintf("ERROR: ISO tool not found: %v", err))
|
||||||
|
return fmt.Errorf("ISO creation setup failed: %w", err)
|
||||||
}
|
}
|
||||||
logFn("Creating ISO image...")
|
logFn("Creating ISO image...")
|
||||||
logFn(fmt.Sprintf(">> %s %s", tool, strings.Join(args, " ")))
|
logFn(fmt.Sprintf(">> %s %s", tool, strings.Join(args, " ")))
|
||||||
if err := runCommandWithLogger(ctx, tool, args, logFn); err != nil {
|
if err := runCommandWithLogger(ctx, tool, args, logFn); err != nil {
|
||||||
return err
|
logFn(fmt.Sprintf("ERROR: ISO creation failed: %v", err))
|
||||||
|
return fmt.Errorf("ISO creation failed: %w", err)
|
||||||
}
|
}
|
||||||
accumulatedProgress += progressForOtherStep
|
accumulatedProgress += progressForOtherStep
|
||||||
progressFn(accumulatedProgress)
|
progressFn(accumulatedProgress)
|
||||||
|
|
||||||
|
// Verify ISO was created
|
||||||
|
if info, err := os.Stat(outputPath); err == nil {
|
||||||
|
logFn(fmt.Sprintf("ISO created successfully: %s (%d bytes)", filepath.Base(outputPath), info.Size()))
|
||||||
|
} else {
|
||||||
|
logFn(fmt.Sprintf("WARNING: ISO file verification failed: %v", err))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
progressFn(100.0)
|
progressFn(100.0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user