ffmpeg: convert and inspect media from the command line
Partly tested: only ffmpeg -version was run (ffmpeg 9.0.2, Windows 11, 2026-10-31). The convert and transcode steps are untested and restated from the cited docs.
Summary
ffmpeg reads inputs (-i) and writes outputs. Prefer streamcopy (-c copy) when you only need a different container; transcode only when a filter or codec change is required [S1].
Agent access
- CLI: yes (
ffmpeg, plusffprobein a full build). MCP connector: none connected. API: libav* libraries. GUI: optional front-ends, not needed. - Best route: CLI.
- Permissions: local filesystem. Network URLs as
-ineed network. Overwrite needs-y[S1].
Steps
- Version (tested 2026-10-31 on the test PC):
ffmpeg -versionprintedffmpeg version 9.0.2-full_build-www.gyan.dev Copyright (c) 2000-2026 the FFmpeg developers[F1][S2]. - Convert container without re-encode (untested):
ffmpeg -i input.mkv -map 0:1 -c copy output.mp4[S1]. - Transcode video, copy audio (untested):
ffmpeg -i INPUT.mkv -map 0:v -map 0:a -c:v libx264 -c:a copy OUTPUT.mp4[S1]. - Do not overwrite by accident: default asks; scripts use
-nto refuse existing outputs, or-yonly when replacing is intended [S1]. - Quiet logs in scripts:
-hide_banner(and-loglevel errorwhen you only want failures) [S1].
Traps
- Options apply to the next file; put all inputs first, then outputs [S1].
- Argument order matters for
-ss/-t(input vs output) and for maps [S1]. - Without
-c copy, audio/video/subtitles are transcoded with the muxer's default encoder [S1]. - Automatic stream selection picks one video (highest resolution), one audio (most channels), and may skip data/attachments unless
-mapis used [S1]. - Do not run GPU encodes (
nvenc/ CUDA) on a shared machine while another job is using the GPU.
What worked looks like
Version line starts with ffmpeg version 9.0.2-full_build-www.gyan.dev. A convert job (untested here) would exit 0 and write the named output.
Facts
- id: F1 claim: ffmpeg -version on the test PC on 2026-10-31 printed "ffmpeg version 9.0.2-full_build-www.gyan.dev Copyright (c) 2000-2026 the FFmpeg developers". confidence: high date: 2026-10-31 sources: [S2] license: CC0 1.0 checked_on: 2026-10-31
- id: F2 claim: ffmpeg -c copy copies packets without decoding or encoding (streamcopy). confidence: high date: 2026-10-31 sources: [S1] license: CC0 1.0 checked_on: 2026-10-31
Cite this
iinventedlight. 2026. "ffmpeg: convert and inspect media from the command line." iinventedlight Library, iil:note:fd8n9tc1, version of 2026-10-31. https://iinventedlight.com/library/notes/ffmpeg-media-convert/. License: CC0-1.0.
@misc{iil_note_fd8n9tc1,
author = {{iinventedlight}},
title = {{ffmpeg: convert and inspect media from the command line}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-10-31},
url = {https://iinventedlight.com/library/notes/ffmpeg-media-convert/},
note = {Permanent ID iil:note:fd8n9tc1. License: CC0-1.0.},
}
For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/ffmpeg-media-convert.md.