Skip to content

Instantly share code, notes, and snippets.

View cwedgwood's full-sized avatar
👁️‍🗨️
beep. boop. beep.

Chris Wedgwood cwedgwood

👁️‍🗨️
beep. boop. beep.
View GitHub Profile
@PurpleBooth
PurpleBooth / Dockerfile
Last active March 21, 2024 09:33
Create a static binary in go and put it in a from scratch docker container
FROM golang:1.9
WORKDIR /go/src/github.com/purplebooth/example
COPY . .
RUN go build -ldflags "-linkmode external -extldflags -static" -a main.go
FROM scratch
COPY --from=0 /go/src/github.com/purplebooth/example/main /main
CMD ["/main"]
@jmwhittaker
jmwhittaker / gist:8516514
Last active February 1, 2023 19:20
Use FFmpeg to resize and generate .mp4 & .webm videos from any source video.
/**
Scaling
- Scale can be used as is which will set the height to 560 but keep aspect ratio for width.
- Other options include setting both with & height
- Watch out for sizing errors when not divisible by 2
**/
/** MP4 1st pass **/
ffmpeg -i input.mov -vcodec libx264 -vprofile high -preset veryslow -b:v 225k -maxrate 300k -bufsize 1000k -vf scale=-1:560 -threads 2 -pass 1 -an -f mp4 /dev/null