ffmpeg

From RaySoft

ffmpeg is a very fast video and audio converter that can also grab from a live audio/video source. It can also convert between arbitrary sample rates and resize video on the fly with a high quality polyphase filter.[1]

Documentation

Syntax

ffmpeg [PARAMETER ...] FILE

Parameters

-c CODEC, -codec CODEC
Select an encoder (when used before an output file) or a decoder (when used before an input file) for one or more streams. CODEC is the name of a decoder/encoder or a special value copy (output only) to indicate that the stream is not to be re-encoded.
-copyts
Do not process input timestamps, but keep their values without trying to sanitize them. In particular, do not remove the initial start time offset value.
-f FORMAT
Force input or output file FORMAT. The FORMAT is normally auto detected for input files and guessed from the file extension for output files, so this option is not needed in most cases.
-i FILE
Input FILE name.
-ss POSITION
When used as an input option (before -i), seeks in this input file to POSITION.
POSITION must be a time duration specification, see the 'Time duration' section in the 'ffmpeg-utils' manual.
-to POSITION
Stop writing the output at POSITION.
POSITION must be a time duration specification, see the 'Time duration' section in the 'ffmpeg-utils' manual.
-y
Overwrite output files without asking.

Examples

Concatenate all mp4 files in a directory...[2]
ffmpeg -f 'concat' -i <(printf "file '$PWD/%s'\n" ./*.mp4) -c 'copy' 'output.mp4'
...and the same for avi files
ffmpeg -f 'concat' -i <(printf "file '$PWD/%s'\n" ./*.avi) -c 'copy' 'output.avi'

References