## FFmpeg Cheat Sheet Let's start with some basics: `-i` is follwed by the path to the source video `-c:v` sets the video codec you want to use. Options include `libx264` for H.264, `libx265` for H.265/HEVC, `libvpx-vp9` for VP9, and `copy` if you want to preserve the codec of the source video `-b:v` `-c:a` `-b:a` Get video info ``` ffmpeg -i input.mp4 ``` Tanscode video to H.264/AVC ``` ffmpeg -i input.mp4 -c:v libx264 -b:v 15M -pix_fmt yuv420p -c:a aac -b:a 192k output.mp4 ``` Resize video to UHD ``` ffmpeg -i input.mp4 -vf scale=3840x2160,setdar=16:9 -vcodec copy -acodec copy out.mp4 ``` Getting video info | ffmpeg -i video.mp4 Concat Replace audio | remove audio -an | extract audio Cut piece out of a video Encode to VP9 Encode to H265 Encode to H264 Encode sequence Stereo to mono Change fps, change resolution