Skip to content

Instantly share code, notes, and snippets.

@Cobesz
Created September 30, 2022 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cobesz/e56ffb051c3fac426861e8fc1c198c41 to your computer and use it in GitHub Desktop.
Save Cobesz/e56ffb051c3fac426861e8fc1c198c41 to your computer and use it in GitHub Desktop.
Gnome screenshot tool allows you to record screencasts in webm format. For some usecases (documentation for example) I want to convert this screencast to a mp4 format so I can easily share it to contacts in Whatsapp/Telegram/Signal or some other application that doesn't support webm playback.
#!/bin/bash
INPUT="$1"
OUTPUT="$(basename "${INPUT%.*}")"
ffmpeg -i "${INPUT}" \
-vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" \
"${OUTPUT}.mp4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment