trim video in emacs Archives - Global Travel Noteshttps://dulichbaolocaz.com/tag/trim-video-in-emacs/Sharing real travel experiences worldwideSun, 15 Feb 2026 16:27:10 +0000en-UShourly1https://wordpress.org/?v=6.8.3Video Clips With Emacshttps://dulichbaolocaz.com/video-clips-with-emacs/https://dulichbaolocaz.com/video-clips-with-emacs/#respondSun, 15 Feb 2026 16:27:10 +0000https://dulichbaolocaz.com/?p=5066Emacs isn’t a traditional video editorbut it’s an amazing command center for video clips. This guide shows how to build a practical “Video Clips With Emacs” workflow by combining mpv for controllable playback, FFmpeg for trimming and exporting, and Org mode for timestamped notes that become a reusable clip manifest. You’ll learn when to stream-copy vs re-encode for precision, how to generate clean GIFs, and how to keep your clip commands organized so you can repeat them reliably. We’ll also cover popular Emacs approaches for watching media, capturing timestamp links, and managing a personal library of source videos and finished clipswithout turning your desktop into a chaos museum of ‘final-final-v3.mp4’ files. If you want a keyboard-driven way to capture highlights, prep demo snippets, or build study clips, this article will help you do it faster and with fewer context switches.

The post Video Clips With Emacs appeared first on Global Travel Notes.

]]>
.ap-toc{border:1px solid #e5e5e5;border-radius:8px;margin:14px 0;}.ap-toc summary{cursor:pointer;padding:12px;font-weight:700;list-style:none;}.ap-toc summary::-webkit-details-marker{display:none;}.ap-toc .ap-toc-body{padding:0 12px 12px 12px;}.ap-toc .ap-toc-toggle{font-weight:400;font-size:90%;opacity:.8;margin-left:6px;}.ap-toc .ap-toc-hide{display:none;}.ap-toc[open] .ap-toc-show{display:none;}.ap-toc[open] .ap-toc-hide{display:inline;}
Table of Contents >> Show >> Hide

If you’ve ever looked at Emacs and thought, “Yes, this is obviously where my video workflow belongs,”
congratulations: you are exactly the kind of person this article was written for. For everyone else: don’t worry.
Nobody’s asking Emacs to replace a full video editor. We’re just using it for what it’s secretly great at
orchestrating tools, wrangling text-based metadata, and turning a messy “I need a clip” moment into a repeatable system.

In other words, this isn’t “edit a blockbuster in Emacs.” This is “trim, catalog, annotate, and export video clips
with less friction,” using a workflow that feels like writing code: fast feedback, small commands, and lots of keyboard.

Why Emacs for video clips?

Video work usually breaks down into two realities:
(1) the pixels, and (2) everything around the pixels. The “around” part is where Emacs shines:
naming, organizing, timestamping, clipping lists, repeatable commands, notes, checklists, and turning “that moment”
into something you can reliably find again next week.

What Emacs is (and isn’t) in this setup

  • Emacs is your command center: you trigger clip commands, store timestamps, and manage a clip library.
  • Emacs is your note-taking and linking engine: you create clickable, timestamped references to moments.
  • Emacs is not a traditional timeline editor (and it doesn’t need to be).

The magic trick is simple: let specialized tools do the heavy lifting (playing and encoding), and let Emacs do the
“make it a workflow” part. If that sounds like “Unix philosophy but with more parentheses,” you’re in the right place.

The toolkit: mpv, FFmpeg, Org mode, and a dash of Emacs Lisp

mpv: the player you can boss around

For clipping, you need precise playback controljumping to times, pausing, scrubbing, and verifying start/end points.
mpv is a lightweight player with a robust control interface, which makes it ideal for being driven from Emacs.
Instead of “open a player and hunt for the time,” you can build workflows where Emacs records timestamps and mpv obeys.

FFmpeg: the Swiss Army chainsaw

If video files are the forest, FFmpeg is the tool that can both carefully prune a branch and also,
if you sneeze, cut down the entire tree. It’s the standard toolbox for trimming, converting, extracting audio,
generating GIFs, probing metadata, and exporting web-friendly clips.

Org mode: your timeline, your brain

Org mode’s superpower is structured text that stays flexible: headings, checklists, tables, links, and metadata.
For video clipping, you can store:

  • Clip candidates as bullet lists
  • Start/end timestamps
  • Notes about what the clip is for (demo, tutorial, social snippet, study)
  • Links you can click later to jump right to the moment

Workflow 1: Trim video clips with FFmpeg from inside Emacs

This workflow is the “power user’s espresso shot”: you already know what you want, you just need to cut it cleanly,
name it well, and move on. The simplest approach is to run FFmpeg commands from within Emacs using
M-x shell-command, M-x async-shell-command, or a dedicated compilation buffer so you can rerun and tweak quickly.

Fast cut (no re-encoding): great when keyframes cooperate

If you want speed and minimal quality loss, you can copy the streams without re-encoding. This is fast and preserves quality,
but it can be slightly imprecise depending on keyframes.

Use this when you’re clipping for internal sharing, quick drafts, or when “close enough” is actually close enough.
If you notice your clip starts a fraction early/late, don’t panickeyframes are doing keyframe things.

Frame-accurate cut (re-encode): slower, but obeys your timestamps

When precision matterstutorials, demos, or anything where the first frame must be exactre-encoding is the reliable option.

Tip: -crf controls quality (lower is higher quality). -preset trades speed for compression efficiency.
For most practical clip workflows, “veryfast” is a great default because you’re clipping, not archiving cinema history.

Make a GIF the non-embarrassing way

GIFs are still everywhere. They’re also huge if you do them wrong. A common high-quality method is to generate a palette first,
then create the GIF using that palette.

Export a web-friendly MP4 (fast loading, fewer surprises)

If you’re publishing clips on the web, you generally want a widely supported codec and “fast start” playback
(so the video starts before fully downloading).

This kind of “final mile” export is where Emacs helps: you can keep a reusable snippet library (Org file, Yasnippet,
or a personal command cookbook) so you’re not reinventing the same flags every time.

Workflow 2: Watch, take timestamped notes, and turn them into clips

This is where Emacs starts feeling unfair (in a good way). Instead of manually writing down times, you create notes
that automatically include timestamps while the media plays. Later, those notes become your clipping checklist,
complete with links that jump to the right moments.

Control mpv from Emacs with mpv.el

mpv.el is designed to control an mpv process from Emacs through mpv’s IPC interface. The practical benefit:
Emacs can start playback and perform actions like seeking, pausing, and jumping to positionsperfect for note-taking.
It also pairs nicely with Org by letting you add link types that trigger playback or seek behavior.

In plain English: you can turn “00:13:42 is the good part” into a clickable link in your Org notesthen click it later
and land exactly where you meant.

Interactive note-taking with org-media-note

If you want a purpose-built workflow for “watch media, capture timestamped notes,” org-media-note is a standout.
It supports both local files and online media (with the right helper tools installed), provides media controls,
and uses link types like video: and audio: with timestamps.

A typical note might look like this conceptually:

Once you have a list like that, you’re basically holding a “clip playlist” in text form. That’s the Emacs advantage:
your notes are already structured data.

Alternatives: org-mpv-notes and mpvi

You’ll see a family of approaches here:

  • org-mpv-notes focuses on taking Org-mode notes tied to mpv playback and jumping to timestamps.
  • mpvi aims for a broader “watch + notes” experience, integrating mpv with Emacs media tooling and Org workflows.

The right choice depends on your style: do you want a minimal “timestamp links and go,” or a more integrated viewing-and-notes setup?
The good news is that all of these approaches share the same idea: mpv plays, Emacs records, Org organizes.

Workflow 3: Organize your video clips like a library with EMMS

The Emacs Multi-Media System (EMMS) is about organizing and playing media by calling external players.
If you have a folder full of recordings, lectures, demos, or reference clips, EMMS can help you treat them like a browsable catalog:
playlists, metadata, and quick playback.

Where EMMS fits in a clipping workflow

  • Collect source media into playlists (what you plan to review)
  • Quickly jump around files and keep track of what you’ve already processed
  • Pair with notes in Org mode so your “library” and “annotations” stay connected

Think of EMMS as your “media inbox” and Org as your “processing notes.” When you combine them, you get a workflow that feels
like GTD for video: capture, review, extract, archive.

Workflow 4: Play video inside Emacs (EAF and friends)

Sometimes you don’t want to context-switch at allyou want video playback inside the Emacs frame. That’s where the
Emacs Application Framework (EAF) video player options come in. EAF provides Emacs-integrated applications,
including video playback modules.

Pros

  • Single-window workflow: your notes and playback can sit side-by-side
  • Feels cohesive: fewer app switches, fewer “where was I?” moments

Cons (a polite way of saying “it’s a bigger setup”)

  • More dependencies and configuration than “install mpv and go”
  • May require troubleshooting on some systems and setups

If you love integrated environments, EAF can be worth it. If you value simplicity, controlling an external mpv window from Emacs is often
the fastest route to “working today.”

Practical examples you can steal immediately

Example 1: Clip a 12-second bug repro from a screen recording

  1. Play the recording in mpv (triggered from Emacs if you want).
  2. Find the exact start/end times. Put them in an Org list.
  3. Run a frame-accurate FFmpeg command from Emacs to export the clip.
  4. Name it like a professional: bug-1427-null-pointer-repro.mp4 (future you will cry tears of gratitude).

Example 2: Turn lecture notes into a “highlight reel” for studying

As you watch, capture timestamped notes whenever something clicks: definitions, worked examples, summary moments.
At the end, you have a list of “high value” segments. Export them as short clips, or keep them as timestamp links
for quick review. Both approaches beat scrubbing through a two-hour lecture every time you forget one detail.

Example 3: Make consistent social snippets from long-form content

If you produce content (tutorials, talks, demos), you can standardize exports:
fixed resolution, consistent audio level targets, and a naming convention. Emacs helps by keeping the process documented
and repeatable: your Org file becomes a production checklist and a clip manifest.

Common pitfalls (and how to avoid becoming a cautionary tale)

1) “Why is my cut slightly off?”

Stream-copy cuts can land near keyframes rather than exactly where you asked. If you need precision, re-encode the clip.

2) “Why is audio weird?”

Mixing sources, variable frame rates, and inconsistent audio codecs can cause surprises. A “normalize to a standard export”
step (H.264 + AAC for MP4) often reduces playback issues across platforms.

3) “My workflow is a pile of commands in my shell history.”

That’s a phase. Then you put your best commands in an Org file (or snippets), add a few templates, and suddenly you’re running
a tiny personal clipping studio. Emacs doesn’t just run commandsit helps you turn them into a system.

4) “I can’t find my clips later.”

Use consistent names and store clip metadata. Even a simple Org table like “source → start → end → output filename → purpose”
will save you from scrolling through a folder of final-final-v3-actually-final.mp4.

Conclusion

“Video Clips With Emacs” works when you stop asking Emacs to be a timeline editor and start using it as a workflow engine.
Combine:
mpv for controllable playback,
FFmpeg for cutting and exporting,
and Org mode for structured notes and clip manifests.
The result is a setup that’s fast, repeatable, and oddly satisfyinglike version control for your video moments.

And yes, you’ll still occasionally open a traditional editor. That’s fine. Emacs isn’t jealous.
(Okay, it’s a little jealous. But it will forgive you if you bind a key to your favorite FFmpeg command.)

Experience section: what it feels like to build a “video clips with Emacs” workflow (500-ish words)

The first time you try to clip video with Emacs, it usually starts with optimism and ends with you muttering,
“Why does this file have three audio tracks and an opinion about time itself?” That’s normal. The early experience
is less about mastering every flag and more about discovering a rhythm that matches how you already work.

In the beginning, you’ll probably do the “ping-pong workflow”: play a video, pause, write down a timestamp somewhere,
alt-tab, run a command, realize you mistyped the time, repeat. It’s annoyingbut it teaches you exactly what Emacs is good at:
reducing friction between steps. The moment you move your timestamps into an Org list and start reusing command templates,
the workflow suddenly clicks. Your notes stop being passive commentary and become executable instructions.

Then comes the fun part: you start noticing how video clipping is basically data entry with a fancy output.
Start time, end time, label, purpose, export settings. Emacs loves structured data entry. You’ll experiment with
an Org table for clip candidates, or headings per clip, and you’ll be surprised how quickly it becomes a mini database
you can search, sort, and reuse. You’ll also discover that “future you” is the most important audienceso you begin
writing filenames and descriptions like you’re leaving clues for an investigator (because you are).

Once you integrate mpv control and timestamp links, it feels like leveling up. Instead of “I think the good part is around 14 minutes,”
you can click a link and jump to exactly 14:03. Even better: you can capture multiple highlights while watching,
without interrupting your flow. Your Org file becomes a living set of bookmarks. That’s the moment the workflow stops feeling like
“video editing in Emacs” and starts feeling like “Emacs-assisted video thinking.”

You’ll also pick up a few practical habits:

  • Always validate boundaries by replaying a few seconds before and after your timestamps.
  • Keep two export modes: a fast draft (stream copy) and a precise final (re-encode).
  • Store a clip manifest so you can regenerate exports later without rewatching everything.
  • Write down what the clip is for (bug repro, tutorial, reference, social), because purpose changes how you export.

After a week or two, something funny happens: you stop thinking of FFmpeg commands as “commands” and start thinking of them as “verbs”
in your workflowclip, convert, gif, extract audio, normalize, publish. Emacs becomes the place where those verbs live, along with the
nouns (files) and the story (notes). At that point, you’re not just making clips. You’re building a personal media system that matches
how your brain already likes to operate: keyboard-first, repeatable, and searchable.

And yes, occasionally you’ll still end up with a file named clip2-REALFINAL-this-one.mp4.
The difference is: now you’ll also have an Org entry explaining why it exists. Progress!

The post Video Clips With Emacs appeared first on Global Travel Notes.

]]>
https://dulichbaolocaz.com/video-clips-with-emacs/feed/0