Skip to content

Instantly share code, notes, and snippets.

View knickers's full-sized avatar

Nick Cox knickers

  • The Desert
View GitHub Profile
@knickers
knickers / gifify.sh
Last active December 19, 2020 06:46
Make a gif with ffmpeg
#!/bin/bash
set -e
usage() {
echo "Usage: $0 [options] source.ext destination.gif"
echo ' -c crop output image. W:H:X:Y Pixels from top left corner'
echo ' -fps output Frames Per Second'
echo ' -s scale output image. X:Y ex: 480:360 or 480:-1 or -1:360'
echo ' -ss start time in hh:mm:ss.xxx or seconds'
echo ' -t duration in hh:mm:ss.xxx or seconds'
@knickers
knickers / ffmpeg-notes.md
Last active February 17, 2020 21:48
ffmpeg notes

Cut video

$ ffmpeg -i input.mp4 -ss HH:MM:SS.xxx -c copy -t HH:MM:SS.xxx output.mp4

Or use -to to specify end timestamp instead of duration. Leave off the end time to go to the end of the video.

Crop video

$ ffmpeg -i input.mp4 -filter:v "crop=w:h:x:y" output.mp4
@knickers
knickers / pull-requests.md
Last active August 16, 2020 18:55
How to make multiple pull requests to a forked repository.

How to make multiple pull requests to a forked repository.

One-time preparation

From inside the forked repository, add a new remote pointing to the upstream repository.

$ git remote add upstream git://github.com/upstream/repo.git
$ git pull upstream master