Fix DVD authoring SCR errors and queue animation persistence

DVD Authoring Fix:
- Add remultiplex step after MPEG encoding for DVD compliance
- Use ffmpeg -fflags +genpts -c copy -f dvd to fix timestamps
- Resolves "ERR: SCR moves backwards" error from dvdauthor
- FFmpeg direct encoding doesn't always create DVD-compliant streams
- Remux regenerates presentation timestamps correctly

Queue Animation Fix:
- Stop stripe animation on completed jobs
- Bug: Refresh() was always incrementing offset regardless of state
- Now only increments offset when animStop != nil (animation running)
- Completed/failed/cancelled jobs no longer show animated stripes

Testing:
- DVD authoring should now succeed on AVI files
- Completed queue jobs should show static progress bar

🤖 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-25 21:20:14 -05:00
parent e919339e3d
commit 49e01f5817
2 changed files with 30 additions and 3 deletions

View File

@ -1615,7 +1615,28 @@ func (s *appState) runAuthoringPipeline(ctx context.Context, paths []string, reg
if err := runCommandWithLogger(ctx, platformConfig.FFmpegPath, args, logFn); err != nil {
return err
}
mpgPaths = append(mpgPaths, outPath)
// Remultiplex the MPEG to fix timestamps for DVD compliance
// This resolves "SCR moves backwards" errors from dvdauthor
remuxPath := filepath.Join(workDir, fmt.Sprintf("title_%02d_remux.mpg", i+1))
remuxArgs := []string{
"-fflags", "+genpts",
"-i", outPath,
"-c", "copy",
"-f", "dvd",
"-y",
remuxPath,
}
if logFn != nil {
logFn(fmt.Sprintf(">> ffmpeg %s (remuxing for DVD compliance)", strings.Join(remuxArgs, " ")))
}
if err := runCommandWithLogger(ctx, platformConfig.FFmpegPath, remuxArgs, logFn); err != nil {
return fmt.Errorf("remux failed: %w", err)
}
// Remove original encode, use remuxed version
os.Remove(outPath)
mpgPaths = append(mpgPaths, remuxPath)
advance("")
}

View File

@ -171,8 +171,14 @@ func (r *stripedProgressRenderer) MinSize() fyne.Size {
}
func (r *stripedProgressRenderer) Refresh() {
// small drift to animate stripes
r.bar.offset += 2
// Only animate stripes when animation is active
r.bar.animMu.Lock()
shouldAnimate := r.bar.animStop != nil
r.bar.animMu.Unlock()
if shouldAnimate {
r.bar.offset += 2
}
r.Layout(r.bg.Size())
canvas.Refresh(r.bg)
canvas.Refresh(r.stripes)