github derekshreds/Snacks v2.1.0
Snacks v2.1.0

9 hours ago

Snacks v2.1.0

Automated Video Library Encoder

Major release adding SQLite database persistence, AV1 encoding, .NET 10, and numerous bug fixes and quality-of-life improvements.


What's New

SQLite Database

  • Persistent file tracking -- all scanned files are stored in a SQLite database with codec, bitrate, resolution, duration, and status. No more re-scanning hundreds of thousands of files after a container restart.
  • Queue survives restarts -- queued and in-progress items are automatically restored when the app starts back up.
  • Pause state persisted -- if the queue was paused when the container stopped, it stays paused on restart.
  • Failure tracking -- failed files are recorded with failure count and reason, preventing infinite requeue loops.
  • Change detection -- if a file is replaced with a different version (>10% size change or >30s duration difference), it's automatically treated as a new file and re-queued.
  • One-time migration -- existing SeenFiles from autoscan.json are automatically migrated to the database on first startup.
  • WAL mode -- database uses Write-Ahead Logging with synchronous=NORMAL for crash resilience. A power outage won't corrupt the database.

AV1 Encoding

  • AV1 codec option -- available in the codec dropdown alongside H.265 and H.264.
  • Hardware acceleration -- maps to av1_vaapi (Intel/AMD), av1_qsv (Intel QSV), av1_nvenc (NVIDIA RTX 40+), or libsvtav1 (software).
  • SVT-AV1 software fallback -- if hardware AV1 isn't available (e.g., older NVIDIA GPUs), automatically falls back to libsvtav1 with CRF rate control.
  • Proper SVT-AV1 parameters -- uses -crf 30 -preset 6 instead of the x265-style flags that SVT-AV1 rejects.

Stop vs Cancel

  • Two-option dialog -- clicking the X on a queue item now shows a modal with two choices:
    • Stop (Encode Later) -- removes from queue, marks as "Stopped" (yellow badge), will be re-queued on next auto-scan.
    • Cancel (Don't Reprocess) -- permanently cancels, won't be re-queued unless manually selected again.
  • Process Selected overrides everything -- explicitly selecting a file in the browser and clicking "Process Selected" always queues it, regardless of failed/cancelled/completed status in the database.

New Settings

  • 4K Bitrate Multiplier -- configurable 2x-8x multiplier for 4K content (was hardcoded to 4x). Available as a dropdown in video settings.
  • Skip 4K Videos -- checkbox to leave 4K content completely untouched.
  • Output Directory -- new text input to specify where encoded files are saved. If "Replace Original Files" is enabled, files are moved back to the original location after encoding.
  • Replace Original Files -- renamed from "Delete Original Files" with updated behavior: when an output directory is set, the encoded file is moved back to the original's directory after deleting the original.

Per-File Logging

  • Log files written to disk -- every encode writes a log file to the logs directory (e.g., The Matrix (1999)_a3f2b1c4.log).
  • Logs viewable after the fact -- clicking the log button on any completed, failed, cancelled, or stopped item loads the log from disk. No longer blank after a page refresh or restart.
  • Smart auto-scroll -- log viewer only auto-scrolls to bottom if you're already near the bottom. Scrolling up to read earlier lines won't get yanked back down.

Bug Fixes

  • Failed file requeue loop fixed -- files that fail encoding are now tracked in the database and won't be endlessly re-queued by auto-scan. Previously, a high-bitrate failing movie would be re-added at the front of the queue every scan cycle.
  • VAAPI hardware decode crash fixed -- new retry step: software decode + VAAPI encode. When VAAPI hardware decoding fails mid-stream (e.g., format/resolution changes), the encode retries with software decoding while keeping GPU encoding. Retry chain is now: strip subtitles -> software decode + VAAPI encode -> full software fallback.
  • Partial [snacks] file detection -- auto-scan now validates existing [snacks] files by probing their duration. Corrupt/partial files from interrupted encodes are deleted and the original is re-queued.
  • Clean slate before encode -- any existing partial [snacks] output file is deleted before starting an encode, preventing conflicts from prior interrupted runs.
  • 1080p skip threshold tightened -- files within 20% of target bitrate are skipped (was 50%), allowing more potential savings.
  • Transfer-safe scanning -- auto-scan skips files modified within the last 30 minutes to avoid processing files mid-transfer.
  • Network drive support -- Windows desktop file browser now shows mapped network drives.

Framework Upgrades

  • .NET 10.0 -- upgraded from .NET 8.0 (LTS through 2028).
  • EF Core 10.0 -- Entity Framework Core for SQLite database.
  • Electron 41 -- upgraded from Electron 33.
  • Jellyfin FFmpeg 7 -- latest available for Ubuntu Noble (the .NET 10 base image uses Ubuntu 24.04).

UI Improvements

  • Tablet-responsive layout -- library browser and settings modal no longer have excessive padding at tablet sizes. Directory/file panels stack vertically below 992px. Simple dialogs (stop/cancel) stay centered instead of going fullscreen.
  • Settings backup -- settings are written atomically (write to .tmp, copy current to .bak, rename .tmp). If settings.json is corrupted, the app falls back to .bak.
  • Process Selected button resets -- no longer shows stale selection count when reopening the library browser.
  • All compiler warnings resolved -- clean build with 0 warnings on .NET 10.

Deployment

NAS (Docker)

docker pull derekshreds/snacks-docker:latest

The config volume now stores both settings.json and the SQLite database (snacks.db). Make sure the config volume is mounted:

volumes:
  - /share/CACHEDEV1_DATA/snacks/config:/app/work/config
  - /share/CACHEDEV1_DATA/snacks/logs:/app/work/logs

Windows Desktop

Download the installer from the Releases page, or build from source:

build-installer.bat

Requires .NET 10 SDK to build from source.


Files Changed

New Files

  • Snacks/Data/SnacksDbContext.cs -- EF Core database context with MediaFile entity
  • Snacks/Data/MediaFileRepository.cs -- repository for all database operations
  • Snacks/Data/DesignTimeDbContextFactory.cs -- EF Core migration tooling support
  • Snacks/Data/Migrations/ -- auto-generated initial migration
  • Snacks/Models/MediaFile.cs -- database entity with status, codec, bitrate, resolution, failure tracking

Modified Files

  • Snacks/Services/TranscodingService.cs -- database integration, AV1 encoding, VAAPI sw-decode retry, stop/cancel, per-file logging, force override, change detection
  • Snacks/Services/AutoScanService.cs -- database migration from SeenFiles, batch queries, partial file validation, transfer-safe scanning, pause persistence, queue resume
  • Snacks/Controllers/HomeController.cs -- new endpoints (stop, retry, failed files, logs), settings backup, network drives
  • Snacks/Models/EncoderOptions.cs -- FourKBitrateMultiplier, Skip4K fields
  • Snacks/Models/AutoScanConfig.cs -- SeenFiles removed, QueuePaused added
  • Snacks/Models/WorkItem.cs -- Stopped status added
  • Snacks/Views/Shared/_EncoderOptions.cshtml -- AV1 codec, 4K multiplier, Skip 4K, Output Directory, Replace Original Files
  • Snacks/Views/Home/Index.cshtml -- stop/cancel modal, responsive classes
  • Snacks/wwwroot/js/transcoding.js -- stop/cancel dialog, AV1 encoder mapping, settings save/restore, log loading from server, auto-scroll fix, process button reset
  • Snacks/wwwroot/css/site.css -- tablet breakpoints, stopped status badge, scoped fullscreen modals
  • Snacks/Program.cs -- database registration, auto-migration
  • Snacks/Snacks.csproj -- .NET 10, EF Core packages
  • Snacks/Dockerfile -- .NET 10, Ubuntu Noble, jellyfin-ffmpeg7
  • electron-app/package.json -- Electron 41
  • docker-compose.yml -- fixed FFmpeg paths, added config volume
  • deploy-compose.yml -- cleaned up, updated comments
  • build-electron.bat, build-installer.bat, run-electron-dev.bat -- net10.0 paths
  • README.md -- updated for all new features

Full documentation: README.md

Don't miss a new Snacks release

NewReleases is sending notifications on new releases.