

Good for storing video at fixed quality if file size is not importantįfmpeg -i -c:v libx264 -crf 23 -c:a aac -b:a 128k output.mkvįor H.264, CRF between 18 and 28 looks “good”, lower is better. Maintain constant quality across the entire encode vbr to set constant quality for FDK-AAC encoder crf to set Constant Rate Factor for libx264/libx265 q:v or -q:a to set fixed-quality parameter

Target bitrate depends on the video genre, size and framerateĮ.g., -b:v 1000K = 1000 kbit/s, -b:v 8M = 8 Mbit/s Generally: You need to choose a target bitrate or quality level The output quality depends on encoder defaults and the source materialĭo not just encode without setting any quality level! When copying bitstreams (-c copy), ffmpeg may copy frames that are not shown but necessary to includeĬutting with -c copy may yield video that starts with black frames (on unsupported players) When re-encoding video, seeking is always accurate to the timestamp Finally those are passed to the muxer, which writes the encoded packets to the output file.Ĭut a video from timestamp for, or until : After filtering, the frames are passed to the encoder, which encodes them and outputs encoded packets. The decoder produces uncompressed frames which can be processed further by filtering. Encoded packets are then passed to the decoder. When there are multiple input files, ffmpeg tries to keep them synchronized. an and -vn would disable audio or video streamsįfmpeg read input files and get packets containing encoded data from them. c sets the encoder (see ffmpeg -encoders) Transmuxing from one container/format to another – without re-encoding:įfmpeg will take one video, audio, and subtitle stream from the input and map it to the output. Transcoding from one codec to another (e.g. Global options for log output, file overwriting, …įull help: ffmpeg -h full or man ffmpeg – but it’s huge! Encoding with the ffmpeg command line tool
