Skip to content

Conversation

Copy link

Copilot AI commented Oct 27, 2025

Replaces external ffmpegthumbnailer dependency with native ffmpeg thumbnail generation, improving cross-platform compatibility (particularly Windows) and reducing dependencies.

Implementation

Adapted thumbnail generator from anacrolix/webtorrent-public (poster.go):

  • dlna/dms/thumbnail.go: New ffmpeg-based thumbnail generator

    • Uses ffprobe to determine video duration
    • Seeks to 1/4 duration for representative frame extraction
    • Generates PNG via ffmpeg's thumbnail filter with 30s timeout
  • dlna/dms/dms.go: Simplified serveIcon()

    • Removed ffmpegthumbnailer-specific arguments (-s, -q, -t, -c)
    • Added context-based timeout handling
    • Maintains fallback to default icon on failure

Changes

// Before: External tool with custom args
cmd := exec.Command("ffmpegthumbnailer", "-i", filePath, "-o", "/dev/stdout", "-c"+c)

// After: Native ffmpeg with smart seeking
generateThumbnailFFmpeg(ctx, filePath)

Updated:

  • README.rst: Removed ffmpegthumbnailer references
  • Dockerfile: Removed ffmpegthumbnailer package
  • TODO: Removed "Work around lack of ffmpegthumbnailer on Windows"
Original prompt

find a thumbnailer generator that anacrolix wrote that calls ffmpeg to generate thumbnails instead of ffmpegthumbnailer


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 5 commits October 27, 2025 03:11
Co-authored-by: anacrolix <988750+anacrolix@users.noreply.github.com>
Co-authored-by: anacrolix <988750+anacrolix@users.noreply.github.com>
Co-authored-by: anacrolix <988750+anacrolix@users.noreply.github.com>
Co-authored-by: anacrolix <988750+anacrolix@users.noreply.github.com>
Co-authored-by: anacrolix <988750+anacrolix@users.noreply.github.com>
Copilot AI changed the title [WIP] Implement thumbnailer generator calling ffmpeg Replace ffmpegthumbnailer with native ffmpeg thumbnail generation Oct 27, 2025
Copilot AI requested a review from anacrolix October 27, 2025 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants