This cheatsheet provides common FFmpeg commands for converting video to the AV1 format (libsvtav1). It covers various standard resolutions and different audio handling options.
Core Concepts
<input_file>: The source video file (e.g., "video.mp4").
<output_file>: The name of the new AV1 file (e.g., "video.av1.mkv").
-vf "scale=-2:<height>": The video filter that resizes the video. It automatically maintains the aspect ratio and ensures the width is divisible by 2.
-c:v libsvtav1: Specifies the video encoder to use the SVT-AV1 library.
-crf <value>: Constant Rate Factor. This controls the output quality. Lower values mean higher quality (and larger files). A good starting point is 28-30 for 720p/1080p, and a slightly lower value like 26-28 for lower resolutions to preserve detail.
-preset <value>: Controls the encoding speed. 0 is the slowest (best quality) and 10 is the fastest (lower quality for the same CRF). A good balance is typically 5-7.
1. Encoding with Audio Transcoding
Use this option if you want to change the audio codec or if you don't care about preserving the original audio stream. This will re-encode both video and audio.
ffmpeg -i "<input_file>" -c:v libsvtav1 -crf 28 -g 240 -preset 6 -pix_fmt yuv420p10le -vf "scale=-2:480" "<output_file>"
ffmpeg -i "<input_file>" -c:v libsvtav1 -crf 28 -g 240 -preset 6 -pix_fmt yuv420p10le -vf "scale=-2:576" "<output_file>"
ffmpeg -i "<input_file>" -c:v libsvtav1 -crf 30 -g 240 -preset 6 -pix_fmt yuv420p10le -vf "scale=-2:720" "<output_file>"
ffmpeg -i "<input_file>" -c:v libsvtav1 -crf 30 -g 240 -preset 6 -pix_fmt yuv420p10le -vf "scale=-2:1080" "<output_file>"
2. Encoding with Audio Copy
This is the recommended approach for most cases. It re-encodes the video to the new resolution but copies the original audio stream exactly, which is faster and preserves the audio quality.
480p
ffmpeg -i "<input_file>" -c:v libsvtav1 -crf 28 -g 240 -preset 6 -pix_fmt yuv420p10le -vf "scale=-2:480" -c:a copy "<output_file>"
576p
ffmpeg -i "<input_file>" -c:v libsvtav1 -crf 28 -g 240 -preset 6 -pix_fmt yuv420p10le -vf "scale=-2:576" -c:a copy "<output_file>"
720p
ffmpeg -i "<input_file>" -c:v libsvtav1 -crf 30 -g 240 -preset 6 -pix_fmt yuv420p10le -vf "scale=-2:720" -c:a copy "<output_file>"
1080p
ffmpeg -i "<input_file>" -c:v libsvtav1 -crf 30 -g 240 -preset 6 -pix_fmt yuv420p10le -vf "scale=-2:1080" -c:a copy "<output_file>"
3. Useful Flags & Options
-t <seconds>: Stop after a specific duration (e.g., -t 60 to encode the first 60 seconds). Very useful for testing settings on a small clip.
-threads <number>: Manually set the number of CPU threads to use. You can specify a number (e.g., 8) or use 0 to let FFmpeg auto-select.
-c:s copy: Copy the subtitle streams from the input to the output.
-map 0: A powerful flag to ensure all streams (video, audio, subtitles, etc.) are copied from the input to the output. This is a good way to be safe if you have multiple streams in your file.
Example using multiple flags
ffmpeg -i "input_file.extention" -t 120 -c:v libsvtav1 -crf 30 -g 240 -preset 6 -pix_fmt yuv420p10le -vf "scale=-2:720" -map 0 -c:a copy -c:s copy "output_file.extention"
This command encodes the first 120 seconds of the video to 720p, copies all audio and subtitle streams, and places the result in a new file.