显示 HN:fftool – FFmpeg 的终端用户界面 – 在运行前显示命令
Show HN: fftool – A Terminal UI for FFmpeg – Shows Command Before It Runs

原始链接: https://bensantora.com/posts/fftool-ffmpeg-tui-go/

## fftool:一个可导航的 ffmpeg 界面 ffmpeg 是一款功能强大但以复杂著称的 Linux 媒体处理工具。**fftool** 旨在简化其使用,同时不抽象其功能。这款基于 Go 的终端 UI 将 27 个常用 ffmpeg 操作(包括修剪、转换、稳定化,甚至从头生成媒体)封装在一个可导航的菜单系统中。 fftool 的关键特性是透明性:在*任何*命令运行之前,它都会显示带有所有标志的完整 ffmpeg 调用,让用户学习和理解底层的命令。它还能智能处理多通道工作流程,如稳定化和归一化,自动运行必要的序列。 fftool 并非取代 ffmpeg,而是增强它。用户可以直接从确认屏幕复制命令,用于脚本或 shell 中。ffttool 专注于简洁性和终端原生功能,提供一个独立的二进制文件,并设计成能够无缝集成到现有的 Linux 工作流程中。它既适合 ffmpeg 新手,也适合寻求更易于管理的界面的经验用户。 您可以在 [fftool 工具页面](https://fftool.tools/) 找到更多信息和二进制文件。

这个Hacker News讨论围绕着一个新的终端UI (TUI)工具 `fftool`,用于与FFmpeg交互。 最初的担忧集中在缺乏公开源代码上,用户不愿运行未经审计的二进制文件。开发者 `taskset` 最初解释说他们不再使用GitHub进行原创项目,但理解安全问题,并打算根据附带文章中的说明构建该工具。 在收到反馈后,`taskset` 通过在其网站 ([bensantora.com/downloads/fftool-source.tar.gz](bensantora.com/downloads/fftool-source.tar.gz)) 上发布源代码的tarball和zip文件解决了这个问题。 由于使用了Linux特定的系统调用 (`TIOCGWINSZ`) 来确定终端大小,该工具目前仅适用于Linux。 一些用户对开发者的在线存在(新的GitHub帐户和域名注册)表示怀疑,认为可能存在机器人活动,但开发者坚持该项目是合法的。 用户称赞该工具的“确认屏幕”,它显示生成的FFmpeg命令,有助于学习底层的标志。
相关文章

原文
← Posts

ffmpeg is one of the most capable pieces of software on Linux. It can cut, convert, transcode, normalize, stabilize, resize, concatenate, and generate media from scratch. It can also be genuinely hostile to use. The flag ordering matters. The argument syntax is non-obvious. Two-pass workflows require you to chain invocations manually. And if you don’t use it daily, you’re looking things up every time.

fftool solves that without hiding ffmpeg. It’s a terminal UI written in Go — a navigable menu that wraps the common operations and shows you the actual command it’s going to run before it runs it. You pick the operation, fill in the fields, and see the ffmpeg invocation on a confirm screen. Execute it or go back and adjust. Either way, you’re reading real ffmpeg commands, not abstractions.

fftool organizes operations into five categories:

Video — Trim, Convert, Resize, Extract Audio, Merge A/V, Concat, Speed, Reverse, Crop, Stabilize (10 operations)

Audio — Convert, Extract, Sine tone, Noise, Normalize, Trim, Mix (7 operations)

Image — Image to Video, Image Sequence to Video, Extract Frame (3 operations)

Generative — Mandelbrot, Test Source, SMPTE Bars, Conway’s Life, Cellular Automaton, Sine Wave, Noise Source (7 operations)

Info / Probe — ffprobe wrapper with formatted output (1 operation)

The Generative category is worth knowing about. Most people don’t realize ffmpeg can produce test patterns, fractal animations, and signal sources entirely from internal filters — no input file needed. fftool surfaces these. They’re useful for testing pipelines, generating placeholders, or just seeing what ffmpeg can do.

This is the design decision that makes fftool different from a typical GUI wrapper.

Every operation goes through a confirm screen. Before anything executes, fftool renders the full ffmpeg command with all flags and arguments, formatted with line continuations:

ffmpeg \
  -i input.mp4 \
  -ss 00:01:30 \
  -to 00:02:45 \
  -c copy \
  output.mp4

You can review it, go back to adjust the inputs, or confirm and run. The command isn’t generated behind the scenes and quietly executed — it’s shown to you first. Over time, you stop needing the menus for the operations you use most. That’s intentional.

Some ffmpeg workflows require more than one invocation. fftool handles these transparently.

Stabilize runs two passes: the first analyzes motion and writes a vectors file, the second applies the correction. You fill in one form; fftool runs both commands in sequence.

Normalize is a two-phase loudness operation: the first pass runs ffprobe to measure integrated loudness, true peak, and LRA; the second pass encodes with the measured values substituted in. fftool parses the JSON output from pass one and builds the pass two command automatically.

Extract Audio uses a fallback strategy: it tries the primary codec first, and if that fails falls back to a second invocation. You don’t manage any of this.

The confirm screen shows all passes before execution starts, so you can see the full sequence.

During encoding, fftool parses ffmpeg’s stderr in real time and displays a live progress line: frame count, FPS, current time position, bitrate, and speed. The UI uses bubbletea and lipgloss for rendering — the progress updates in place rather than scrolling.

When the job finishes, fftool shows a result screen with the exit status and any relevant output. From there you can return to the form to run again with different settings, or go back to the main menu.

ffmpeg itself is C. Most existing frontends for it are Python scripts, shell wrappers, or Electron apps. Go gives you a single compiled binary, fast startup, and straightforward concurrency for reading stdout and stderr simultaneously without blocking. The TUI state machine — menus, forms, confirm, run, result — maps cleanly to Go’s type system. Adding a new operation means implementing one interface and registering the preset; nothing else touches.

The binary is self-contained — no runtime, no virtualenv, no dependency manager. It works wherever Go’s output works.

fftool is part of the same philosophy as newtop and netsock — terminal-native Go tools that do one thing well and stay out of the way. newtop and netsock are systems tools that read the kernel directly. fftool is a different domain — media processing — but the same approach: readable Go, minimal surface area, works in a terminal, no GUI required.

If you spend time on Linux doing any kind of media work, ffmpeg is probably already on your machine. fftool makes it navigable.

The binary and full operation reference are on the fftool tools page.

FAQ

Q: What is fftool? A terminal UI for ffmpeg written in Go. It wraps 27 common video, audio, image, and generative operations in a navigable menu, shows you the ffmpeg command before executing, and handles multi-pass workflows like stabilization and loudness normalization automatically.

Q: Does fftool replace ffmpeg? No. It wraps it. ffmpeg does all the actual work; fftool builds the command, shows it to you, and runs it. You can copy any command off the confirm screen and run it directly in your shell.

Q: What ffmpeg operations does fftool support? Trim, convert, resize, extract audio, merge audio/video, concatenate, change speed, reverse, crop, and stabilize for video. Convert, extract, generate tones and noise, normalize, trim, and mix for audio. Image-to-video, image sequence, and frame extraction for images. Seven generative sources including Mandelbrot and Conway’s Life. ffprobe for inspection.

Q: What is the Generative category? ffmpeg includes internal filter sources that generate video without any input file — test patterns, signal sources, fractals, cellular automata. fftool exposes these under the Generative menu. Most ffmpeg users have never encountered them.

Q: Does fftool work with any ffmpeg version? It detects whatever version is on your PATH at startup. Operations use standard flags available in ffmpeg 4.x and later. The version string shows in the UI footer.

Q: Does fftool require root? No. It runs ffmpeg and ffprobe as the current user.

Tested on Debian/CrunchBang++. Requires ffmpeg with ffprobe on PATH. Linux only.

联系我们 contact @ memedata.com