Fix DVD authoring VOBU errors with proper MPEG-PS muxing

Critical fix for dvdauthor "Skipping sector at inoffset 0" errors:

- Add -f dvd format to initial MPEG encoding
- Add -muxrate 10080000 (10.08 Mbps DVD standard mux rate)
- Add -packetsize 2048 (DVD packet size requirement)
- Apply same parameters to remux and concat steps
- Ensures proper VOBU (Video Object Unit) boundaries
- Creates DVD-compliant MPEG-PS streams from encoding

This fixes the "dvdauthor structure creation failed" error when
authoring multi-scene DVDs. The MPEG files now have proper DVD
navigation structure that dvdauthor can process.

Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Stu Leak 2025-12-30 15:41:03 -05:00
parent 19739b0fab
commit e1c4d9ca50

View File

@ -1238,6 +1238,9 @@ func concatDVDMpg(inputs []string, output string) error {
"-safe", "0", "-safe", "0",
"-i", listPath, "-i", listPath,
"-c", "copy", "-c", "copy",
"-f", "dvd", // Maintain DVD format
"-muxrate", "10080000", // DVD mux rate
"-packetsize", "2048", // DVD packet size
output, output,
} }
return runCommand(platformConfig.FFmpegPath, args) return runCommand(platformConfig.FFmpegPath, args)
@ -1733,7 +1736,15 @@ func (s *appState) runAuthoringPipeline(ctx context.Context, paths []string, reg
} }
remuxPath := filepath.Join(workDir, fmt.Sprintf("title_%02d_remux.mpg", i+1)) remuxPath := filepath.Join(workDir, fmt.Sprintf("title_%02d_remux.mpg", i+1))
remuxArgs := []string{"-fflags", "+genpts", "-i", outPath, "-c", "copy", "-f", "dvd", "-y", remuxPath} remuxArgs := []string{
"-fflags", "+genpts",
"-i", outPath,
"-c", "copy",
"-f", "dvd",
"-muxrate", "10080000",
"-packetsize", "2048",
"-y", remuxPath,
}
if logFn != nil { if logFn != nil {
logFn(fmt.Sprintf(">> ffmpeg %s (remuxing for DVD compliance)", strings.Join(remuxArgs, " "))) logFn(fmt.Sprintf(">> ffmpeg %s (remuxing for DVD compliance)", strings.Join(remuxArgs, " ")))
} }
@ -2216,6 +2227,9 @@ func buildAuthorFFmpegArgs(inputPath, outputPath, region, aspect string, progres
"-b:a", "192k", "-b:a", "192k",
"-ar", "48000", "-ar", "48000",
"-ac", "2", "-ac", "2",
"-f", "dvd", // DVD-compliant MPEG-PS format
"-muxrate", "10080000", // DVD mux rate (10.08 Mbps)
"-packetsize", "2048", // DVD packet size
outputPath, outputPath,
) )