Skip to content

Instantly share code, notes, and snippets.

@yunho-c
Forked from nickkraakman/ffmpeg-cheatsheet.md
Created July 12, 2025 22:10
Show Gist options
  • Select an option

  • Save yunho-c/d35688d06bada4e812d09ac24806ce97 to your computer and use it in GitHub Desktop.

Select an option

Save yunho-c/d35688d06bada4e812d09ac24806ce97 to your computer and use it in GitHub Desktop.
FFmpeg cheat sheet for 360 video

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment