Skip to content

Instantly share code, notes, and snippets.

@deepansharya1111
Last active December 27, 2025 19:51
Show Gist options
  • Select an option

  • Save deepansharya1111/971c65c6a587148f9345207e72410bab to your computer and use it in GitHub Desktop.

Select an option

Save deepansharya1111/971c65c6a587148f9345207e72410bab to your computer and use it in GitHub Desktop.

Wide Putin Meme Converter (FFmpeg)

Convert any normal MP4 into the classic wide Putin meme using FFmpeg, with a one-click copy of everything you need.

Requirements

  • FFmpeg installed
    • macOS: brew install ffmpeg
    • Linux (Debian/Ubuntu): sudo apt-get install ffmpeg
    • Windows: Use official builds and run in PowerShell (adjust paths)

What it does

  • Scales the video to 2880x1920 for the wide look.
  • Use 1920x1080 for less wider look.
  • Sets Sample Aspect Ratio (SAR) to 1:1 to avoid pixel stretching.
  • Encodes with H.264 using CRF for high quality at reasonable size.
  • Copies audio as-is (no re-encode).
  • Detail: The wide Putin meme is typically around a 3:2 or 4:3 aspect ratio. 2880×1920 command yields 3:2, which looks clean and “wide” without extreme distortion. Many variants also use 2560×1920 or 1920×1440 for a 4:3 feel; the key is horizontal stretching while keeping height reasonable. If you want an even wider gag, you can push toward 2:1 (e.g., 2880×1440), but 3:2 and 4:3 are the most common in circulation.

Quick command

ffmpeg -i input.mp4 -vf "scale=2880:1920,setsar=1" -c:v libx264 -crf 18 -preset medium -c:a copy output_wide_2880x1920.mp4

Script usage

Use this script for checks and friendly defaults:

bash wide-putin.sh input.mp4
# Produces: input_wide_2880x1920.mp4

Specify an explicit output:

bash wide-putin.sh input.mp4 output.mp4

Environment overrides (optional):

CRF=22 PRESET=slow SCALE_W=3200 SCALE_H=1800 bash wide-putin.sh input.mp4

Flags explained

  • -vf "scale=2880:1920,setsar=1": Resize to target resolution and force 1:1 pixel aspect ratio.
  • -c:v libx264: Use H.264 encoder for broad compatibility.
  • -crf 18: Quality level (lower = better quality, larger file). Typical range 18–23.
  • -preset medium: Speed vs compression tradeoff. Options: ultrafast → veryslow.
  • -c:a copy: Copy source audio stream; change to -c:a aac -b:a 192k to re-encode.

Common tweaks

  • Smaller file: increase CRF (e.g., -crf 22).
  • Higher quality but slower: -preset slow or -preset slower.
  • Force 60 FPS output:
    -r 60
  • Re-encode audio if copy fails:
    -c:a aac -b:a 160k
  • Keep original FPS and color space by default; the script doesn’t alter them.

Notes

  • Works with non-MP4 inputs; output is H.264 MP4.
  • Change the wide size by adjusting scale=WIDTH:HEIGHT.
  • Windows PowerShell equivalent:
    ffmpeg -i input.mp4 -vf "scale=2880:1920,setsar=1" -c:v libx264 -crf 18 -preset medium -c:a copy output_wide_2880x1920.mp4

wide-putin.sh

#!/usr/bin/env bash
# Wide Putin Meme Converter
# Usage:
#   bash wide-putin.sh input.mp4 [output.mp4]
#
# Produces a 2880x1920 "wide Putin" style video using H.264 encoding.
# Defaults:
#   - CRF: 18 (good quality)
#   - Preset: medium (balanced speed)
#   - Audio: copy (no re-encode)

set -euo pipefail

INPUT="${1:?Provide input file}"
OUT="${2:-${1%.*}_wide_2880x1920.mp4}"

ffmpeg -i "$INPUT" -vf "scale=2880:1920,setsar=1" -c:v libx264 -crf 18 -preset medium -c:a copy "$OUT"

Security note

  • Run scripts from trusted sources only. This script uses ffmpeg on local files and writes output; no network actions.
  • Avoid hardcoded paths; the script uses your shell PATH and validates input exists.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment