Skip to content

About

Windows/Linux/macOS video toolkit: HEVC/AV1 encoding with hardware encoders (Intel QuickSync, AMD AMF, NVIDIA NVENC), track muxing, chapter editing (ffmpeg + mkvtoolnix, Tkinter GUI)

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

62 Commits

Folders and files

Repository files navigation

MediaForge

Cross-platform (Windows/macOS/Linux) video toolkit — encode to HEVC/AV1 with automatic hardware-encoder detection (Intel QuickSync, AMD AMF, NVIDIA NVENC, Apple VideoToolbox, or software libx265/libsvtav1), mux tracks, and edit chapters. Built around fine per-file control (stream selection, trim, real bitrate, track titles, tag fixes) for files that differ from one another, rather than around batch processing — encoding can also run across a whole folder at once, which is mainly useful when the source files are similar (e.g. clips from the same phone or camcorder sharing the same settings).

Why HEVC/AV1: these are the two codec families actually worth targeting today. HEVC is the most advanced codec with genuinely wide playback compatibility (hardware decode on essentially every modern TV, phone, and media player); AV1 compresses better still, but needs dedicated encode/decode hardware to be practical and is supported by fewer players — worth it when you control the playback side, not a safe default otherwise.

MediaForge screenshot

Features

  • Encode: HEVC or AV1, with an optional scaling cap (1080p/720p, off by default), aspect ratio/FPS/flip filters, per-stream selection (video/audio/subtitles), trim, and a live command preview — for one file with its own settings, or a whole folder of similar files at once
  • Quality (CRF) defaults to a value computed from the selected file's resolution and the chosen encoder — higher resolution and more efficient codecs (AV1) can use a higher CRF for the same perceived quality — instead of one fixed number for every file; stays put once you edit it by hand, with a button to re-enable the automatic default
  • A stalled encode (typically a subtitle track with a corrupted timestamp confusing the muxer's interleaving — seen as time= frozen in the progress line, sometimes alongside a burst of Starting new cluster due to timestamp messages) is detected automatically and retried without subtitles, which are then muxed back in afterward with no re-encoding; the same "exclude, mux back in afterward" behavior is also available as a manual subtitle option to sidestep the issue proactively instead of waiting for the automatic retry. Subtitles muxed back in this way honor the same trim as the rest of the file, instead of being pulled in full from the source
  • Available encoders are detected automatically at startup by actually probing ffmpeg on the current machine (not just checking what it was compiled with), so the app proposes the right one per machine (AMF on AMD, QSV on Intel, VideoToolbox on Apple Silicon…)
  • Rate control: constant quality (CRF) or a target average bitrate in kbps (single-pass VBR, verified with QSV HEVC and libx265; the AMF/NVENC/VideoToolbox/AV1 variants are untested), with an optional 2-pass mode for the software encoders (libx265, SVT-AV1)
  • QSV (HEVC) offers 3 real preset levels (fast / normal / slow), and its default CRF follows values per resolution (480p=14, 720p=16, 1080p=18, 4K=20; only the 4K points rest on real results, see CLAUDE.md); a 4K source scaled down (e.g. to 1080p) gets CRF 14 instead, because at the higher CRFs the detailed scenes lose most of their fine detail (measured on one 4K HDR series)
  • "Predict bitrate": encodes a few short clips (default 3 of 1 minute, at random times or at times you type; a dice button draws a new set of random points each time) with the current settings and shows the bitrate of each, the mean, min and max, and the video size the mean predicts for the whole file. It is an estimate: at the same CRF the bitrate differs a lot between scenes, so look at min and max, not only the mean
  • Live charts: while a file encodes, a window plots encoding speed (fps), speed against real time and the video bitrate (instantaneous and average; the audio is subtracted from ffmpeg's whole-file figure), with elapsed time on the x axis
  • Bitrate over time: after a single-file conversion a window shows the exact video bitrate per minute (30 s to 5 min steps, optional comparison with the source, "Save CSV…"; also from the "📈 Bitrate chart" button for any file). The "Bitrate CSV" checkbox (on by default) also saves the same values as <name>_bitrate.csv next to every converted file
  • On Windows with a QSV encoder, decoding and the resolution-cap scaling both run on the GPU (d3d11va decode, frames kept on the GPU through scale_qsv to the encoder), with HDR/10-bit files keeping their color depth and HDR metadata; other filters (crop/pad/fps/flip) are software and only then pull the frames back to system memory. If hardware decoding fails on a specific file, the app retries it automatically with software decoding
  • "Stop and keep file" closes the current encode cleanly and keeps the playable partial file (the regular "Interrompi" button discards it)
  • The same frame-rate measurement runs by itself when a single file is selected, in a thread. Repeated frames in a whole ratio (60 fps that are really 30) or a variable rate give a warning with a button under the video options. Repeats at any other ratio (24 fps stored as 30) are only reported and the rate is left alone: removing them with the fps filter was seen to discard up to 25% of the real frames and repeat as many others (judder), while keeping them costs about 8% in size. No setting is changed by itself
  • The default output format is the source's own (mkv -> mkv, mp4/m4v/mov -> mp4; anything else, AVI included, -> mkv), changeable before Avvia
  • "Check original FPS": counts the real (non-duplicated) frames on 5 short clips and compares them with the declared rate (e.g. a 24 fps film stored as 30 fps); proposes the matching FPS limit, and also flags variable frame rate
  • Log panel text is selectable and copyable (mouse or Ctrl+C/Ctrl+A) while staying read-only
  • Exact real video bitrate (from packet sizes, not an estimate) and two maintenance tools: fix the HEVC tag some players need for HEVC-in-MP4, and fix a stale/wrong bitrate tag
  • Audio-only mode for extracting/transcoding just the audio track
  • Mux: combine or replace tracks across files without re-encoding, add external audio/ subtitle tracks, edit track titles, extract a single track back out to its own file
  • Chapters: edit a chapter list, import/export in OGM chapter format, apply via mkvpropedit when available (fast, no remux) or a full ffmpeg remux otherwise

Requirements

  • ffmpeg/ffprobe in PATH
  • Python 3 with tkinter (standard library)
  • tkinterdnd2 — optional, enables drag-and-drop file loading
  • mkvtoolnix (mkvpropedit) — optional, enables fast chapter/tag edits without a full remux

Running

pythonw MediaForge.pyw

Structure

  • MediaForge.pyw — main application (a single App class), three tabs (Encode / Mux / Chapters) sharing one log panel

License

MIT

About

Windows/Linux/macOS video toolkit: HEVC/AV1 encoding with hardware encoders (Intel QuickSync, AMD AMF, NVIDIA NVENC), track muxing, chapter editing (ffmpeg + mkvtoolnix, Tkinter GUI)

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages