Check out my first novel, midnight's simulacra!

FFmpeg: Difference between revisions

From dankwiki
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 12: Line 12:
===Extract N seconds starting at time T===
===Extract N seconds starting at time T===
<tt>ffmpeg -i INPUT -c copy -ss T -t N OUTPUT</tt>
<tt>ffmpeg -i INPUT -c copy -ss T -t N OUTPUT</tt>
T can be either a seconds count, or a timestamp i.e. 01:00:20.
* T can be either a seconds count, or a timestamp i.e. 01:00:20.


===Combine input files===
===Combine input files===
<tt>ffmpeg -f concat -safe 0 -i INPUT1 -i INPUT2 -c copy OUTPUT</tt>
<tt>ffmpeg -f concat -safe 0 -i INPUT -c copy OUTPUT</tt>
* INPUT ought be a newline-delimited set of files, each prefaced with "<tt>file </tt>".

Latest revision as of 09:40, 30 May 2022

Best by test. The original quasi-legal, hyperbroad, coldly efficient library for decoding, encoding, and munging digital media.

Build options

  • --enable-gpl forces creation of GPL-only modules (including e.g. delogo). the resulting object is GPL-licensed.
  • --enable-nvenc forces use of NVENC (requires nv-codec-headers)


Recipes

Remove audio

ffmpeg -i INPUT -vcodec copy -an OUTPUT

Extract N seconds starting at time T

ffmpeg -i INPUT -c copy -ss T -t N OUTPUT

  • T can be either a seconds count, or a timestamp i.e. 01:00:20.

Combine input files

ffmpeg -f concat -safe 0 -i INPUT -c copy OUTPUT

  • INPUT ought be a newline-delimited set of files, each prefaced with "file ".