How AutoMKV Simplifies Batch MKV Conversion

AutoMKV Tips & Tricks: Faster, Cleaner MKV RipsAutoMKV is a collection of scripts and presets built around ffmpeg, HandBrakeCLI, and other tools to automate the process of encoding optical media, video files, and ripped streams into high-quality MKV files. Whether you’re archiving a Blu-ray collection, batch-converting old DVDs, or preparing video for a media server, AutoMKV helps standardize output, reduce repetitive tasks, and produce clean, compatible MKV rips. This article walks through practical tips and advanced tricks to speed up encodes, improve visual and audio quality, clean unwanted artifacts and extras, and build a reliable workflow.


1. Understand the core components

AutoMKV typically orchestrates several command-line tools; knowing what each does helps you diagnose issues and optimize:

  • ffmpeg — demuxing, filtering, remuxing, basic encoding, and subtitle handling.
  • HandBrakeCLI — complex H.264/H.265 encoding with tuned presets and filters.
  • MKVToolNix (mkvmerge, mkvpropedit) — assembling tracks, chapters, attachments, and metadata into final MKV.
  • eac3to / tsMuxer / makemkvcon — source-specific extraction (optical discs, transport streams).
  • x265 / x264 — encoders used by HandBrake or ffmpeg for video compression.

2. Choose sensible defaults for speed vs. quality

Balancing speed and quality depends on hardware and priorities. Use these guidelines:

  • For fast transcodes with good quality: HandBrakeCLI with x264, preset “veryfast” to “fast”, CRF ~18–22.
  • For smaller files / better compression: x265 with preset “medium” to “slow”, CRF ~20–24 (x265 CRF values are not directly comparable to x264).
  • For near-lossless archival: use x264 at CRF 14–16 or a two-pass ABR with high bitrate.

Tip: Start with a short test clip (30–60 sec) to evaluate settings before processing an entire disc.


3. Use hardware acceleration wisely

Hardware encoders (NVENC, QuickSync, AMF) greatly reduce encode time but may introduce compression artifacts at the same bitrate.

  • Use hardware encoding when time is critical (e.g., bulk conversions).
  • Increase bitrate or lower preset for hardware encoders to match software quality.
  • Prefer newer NVENC generations (Turing/Ampere) which have much better quality-per-bit.
  • Combine hardware decoding (ffmpeg -hwaccel) with software encoding if encoder quality matters.

4. Automate source detection and selection

AutoMKV scripts can detect and select the best audio and subtitle tracks automatically:

  • Prioritize original language and lossless audio (DTS-HD, TrueHD, FLAC) for preservation.
  • Use mkvmerge to keep lossless audio tracks and only re-encode lossy ones if necessary.
  • Exclude forced/SDH subtitles automatically but keep default and hearing-impaired tracks when present.
  • For TV rips, auto-detect episodes using filename patterns or PGS/SSA timing.

Example heuristic:

  • Keep highest bitrate audio of the main language.
  • Keep all Dolby TrueHD/DTS-HD MA tracks.
  • Convert multi-channel lossy (AC3, DTS) to FLAC only if storage permits; otherwise keep original AC3.

5. Filters: deinterlace, denoise, and sharpen carefully

Applying filters improves perceived quality but can also wash details or amplify noise.

  • Deinterlacing: use only for interlaced sources (VOB, some DVB captures). Prefer decomb or yadif with tuned thresholds.
  • Denoising: use mild denoising (hqdn3d, nlmeans) to reduce encoding artifacts and lower bitrate requirements. Test strength — excessive denoising destroys fine detail.
  • Sharpening: use lightly (unsharp or limiter) after denoise to retain perceived sharpness.
  • Frame rate conversions: avoid unnecessary conversions. If source is 23.976fps, keep it. For 50/60fps sources, only change if you need compatibility.

6. Preserve important metadata and attachments

MKV can hold chapters, cover art, fonts, and menus. Preserve useful attachments, strip junk.

  • Preserve chapter markers where available (use mkvmerge to import chapter XML).
  • Keep fonts for subtitles if rendering requires them (embedded ASS/SSA).
  • Strip extra attachments like duplicate JPEGs or irrelevant PDF files.
  • Use mkvpropedit to set language tags, default/forced flags, and track titles.

7. Audio handling strategies

Audio often determines storage needs. Strategies:

  • Preserve lossless audio where practical (DTS-HD, TrueHD). Store in MKV as-is.
  • For stereo-only content, re-encode to AAC or Opus for smaller size with minimal quality loss. Opus is excellent for streaming and archiving voice-heavy content.
  • For multi-channel lossy tracks, either keep original AC3/DTS or convert to FLAC/TrueHD if wanting lossless.
  • Sync issues: prefer remuxing first to verify timestamps, use ffmpeg -itsoffset or HandBrake audio delay options to correct.

8. Batch processing and job queuing

For large libraries, automation and queuing are essential.

  • Break jobs into manageable chunks (by disc, season, or batch size).
  • Use a per-job config file with source, target preset, and track selection to avoid mistakes.
  • Run multiple encodes in parallel only if CPU/GPU and I/O can handle it. Monitor load and temperature.
  • Log outputs and errors to separate files for troubleshooting.

9. Optimize storage and naming conventions

Consistent naming and storage makes management easier.

  • Adopt a naming scheme: Title (Year) – [Source] – [Codec] – Resolution.
  • Store original rips in a “lossless” folder and encoded MKVs in “playable” or “plex” folders.
  • Use checksums (sha1/sha256) for archived originals.

10. Quality assurance: spot-check and automated checks

Always verify outputs before deleting sources.

  • Spot-check multiple points: opening credits, action sequences, dark scenes, and dialogue scenes.
  • Use automated checks: ffprobe for streams and durations, mediainfo for codecs, and a script to verify presence of expected tracks.
  • Compare PSNR/SSIM/VMAF on test clips if performing aggressive compression to quantify quality loss.

11. Advanced tricks

  • Hybrid workflow: use MakeMKV to remux discs quickly, then run AutoMKV to re-encode only what you choose.
  • Smart re-encoding: remux lossless audio and only re-encode the video or lossy audio tracks.
  • Scene-detection CRF: adapt CRF or bitrate per-scene using two-pass statistics to allocate bitrate where needed.
  • Use x264 –tune and –profile options for specific content (animation, film, grain-heavy). For animation use –tune animation to preserve hard edges.

12. Common pitfalls and fixes

  • Choppy audio/video sync: check timestamps, remux to MKV with ffmpeg, or use -vsync and -async parameters.
  • Subtitle encoding/display issues: prefer UTF-8 SRT or embedded ASS for styling; ensure fonts are included.
  • Over-filtering: if details look smeared, reduce denoise strength or remove sharpening.
  • Excessive filesize with x265: lower CRF or increase preset speed slightly.

13. Example basic AutoMKV workflow (high level)

  1. Rip/disc extraction: MakeMKV or makemkvcon to produce raw MKV.
  2. Analyze: mediainfo/ffprobe to list tracks, durations, and formats.
  3. Decide: choose which video/audio/subtitle tracks to keep or re-encode.
  4. Encode: HandBrakeCLI/ffmpeg with chosen presets and filters.
  5. Assemble: mkvmerge to combine encoded video with preserved audio/subtitles and attachments.
  6. QA: spot-check and run automated scripts.
  7. Archive: move originals to long-term storage and update library database.

  • Maintain a small set of proven presets (e.g., “Plex-1080p x264”, “Archive-x264-lossless”, “Mobile-720p-hw”).
  • Keep a test suite of short clips to evaluate new encoder versions or presets.
  • Track updates to HandBrake, ffmpeg, x265, and MKVToolNix; new releases often bring quality or speed improvements.

Preserving both speed and quality with AutoMKV is about making informed trade-offs, testing, and automating sensible defaults. Start small, validate results, then scale up with batch jobs and monitoring. The payoff is a consistent library of clean, compatible MKV files optimized for playback and long-term storage.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *