ffmpeg Audio/video converter
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
ffmpeg -i <in> <out>
ffmpeg -ss <t> -i <in> -t <dur> -c copy
<out>
ffmpeg -i <in> -vf scale=-2:720 <out>
ffmpeg -i <in> -vn -c:a copy <out>
ffmpeg -i <in> -c:v libx264 -crf 23 <out>
ffmpeg -i <in> -an <out>
ffprobe <file>
ffmpeg -codecsConcepts
- Input -i file
- Decoder raw frames
- Filters scale, trim...
- Encoder codec + quality
- Output container
Basics
ffmpeg -i <in> <out>
ffprobe <file>
ffmpeg -i <in> -c copy <out>
ffmpeg -y -i <in> <out>
ffmpeg -hide_banner -i <in>
ffmpeg -loglevel error -i <in> <out>
ffmpeg -stats -i <in> <out>
ffprobe -v error -show_format -show_streams
<file>
ffprobe -v error -show_entries format=duration -of csv=p=0
<file>
Trim and join
-ss <time> -i <in>
-t <duration>
-to <time>
ffmpeg -ss <t> -i <in> -t <dur> -c copy
<out>
-f concat -safe 0 -i <list.txt> -c copy
<out>
-sseof -<sec> -i <in>
-frames:v 1Video
-c:v libx264-c:v libx265-c:v libvpx-vp9-c:v libsvtav1-crf <n>-preset <name>
-b:v <rate>
-r <fps>-pix_fmt yuv420p
-movflags +faststart
-vn-c:v h264_nvenc-c:v h264_vaapi-tune <name>
-pass 1 / -pass 2
Audio
-vn -c:a copy <out>
-vn -c:a libmp3lame -q:a 2 <out.mp3>
-c:a aac -b:a 128k
-an-ac <n>-ar <hz>-af volume=<factor>
-af loudnorm-c:a libopus -b:a 96k
-c:a flacFilters
-vf scale=<w>:<h>
-vf scale=-2:<h>
-vf fps=<n>
-vf crop=<w>:<h>:<x>:<y>
-vf transpose=1-vf hflip / -vf vflip
-vf setpts=PTS/<n>
-af atempo=<n>
-vf
drawtext=text='<txt>':fontsize=<n>
-vf subtitles=<file.srt>
-vf "scale=iw/2:-2,fps=10"
-filter_complex "<graph>"
-vf yadifStreams and metadata
-map <in>:<stream>
-map 0-map 0:v -map 1:a
-c copy -map 0 -c:s mov_text
-metadata title="<txt>"
-map_metadata -1
-i <sub.srt> -c:s mov_text
-disposition:s:0 default
-itsoffset <sec> -i <in>
Discovery
ffmpeg -codecsffmpeg -encoders
ffmpeg -formatsffmpeg -filtersffmpeg -h encoder=<name>
ffmpeg -h filter=<name>
ffmpeg -hwaccels
ffmpeg -versionRecipes
ffmpeg -i in.mov -c:v libx264 -crf 26 -preset slow \ -vf scale=-2:720 -pix_fmt yuv420p \ -c:a aac -b:a 128k -movflags +faststart out.mp4
ffmpeg -i in.mp4 -vf "fps=12,scale=480:-1:flags=lanczos,palettegen" pal.pngffmpeg -i in.mp4 -i pal.png -lavfi "fps=12,scale=480:-1:flags=lanczos[x];[x][1:v]paletteuse" out.gif
# every second as PNGffmpeg -i in.mp4 -vf fps=1 frame_%04d.png# images to videoffmpeg -framerate 25 -i frame_%04d.png -c:v libx264 -pix_fmt yuv420p out.mp4
ffmpeg -i video.mp4 -i audio.m4a -map 0:v -map 1:a \ -c copy -shortest out.mp4



