Great notes on this blog: How to create GIFs with FFmpeg
Rename all of the target images to have a sequential naming scheme.
a=1; for i in *.png; do new=$(printf "%04d.png" "$a"); mv -i -- "$i" "$new"; let a=a+1; done
#!/usr/bin/env bash | |
# Reduce a gif down to a desired number of frames. | |
# Useful for really large gifs that you'd like to truncate. | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
PROJ_DIR=$(realpath "${DIR}/..") | |
TEMP_DIR=$(mktemp -d ) | |
REDUCED_DIR=$(mktemp -d) |
{{- $.Page.Scratch.Add "figurecount" 1 }} | |
{{ $galleryCount := $.Page.Scratch.Get "figurecount" }} | |
{{- if eq $galleryCount 1 }} | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/fancyapps/[email protected]/dist/jquery.fancybox.min.css" /> | |
<style> | |
.gallery { | |
display: flex; | |
flex-flow: row wrap; | |
width: 100%; |
Great notes on this blog: How to create GIFs with FFmpeg
Rename all of the target images to have a sequential naming scheme.
a=1; for i in *.png; do new=$(printf "%04d.png" "$a"); mv -i -- "$i" "$new"; let a=a+1; done
#!/usr/bin/env bash | |
# | |
# Author: Stefan Buck | |
# License: MIT | |
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447 | |
# | |
# | |
# This script accepts the following parameters: | |
# | |
# * owner |
func processResults(results <-chan result) { | |
for r := range results { | |
if r.err != nil { | |
log.Printf("Frame result with an error: %v\n", r.err) | |
continue | |
} | |
log.Printf("Mouse detected! frame: %d, detectors: %v\n", r.frame, r.detectors) | |
image, err := jpeg.Decode(r.file) | |
if err != nil { |
type result struct { | |
// the frame number | |
frame int | |
// The detected bounds | |
detectors []objectbox.CheckDetectorResponse | |
file io.Reader | |
err error | |
} | |
func checker(done <-chan struct{}, frames <-chan frame, results chan<- result) { |
func extractFrames(done <-chan struct{}, filename string) (<-chan frame, <-chan error) { | |
framec := make(chan frame) | |
errc := make(chan error, 1) | |
go func() { | |
defer close(framec) | |
video, err := gocv.VideoCaptureFile(filename) | |
if err != nil { | |
errc <- err |
version: '3' | |
services: | |
objectbox1: | |
image: machinebox/objectbox | |
environment: | |
- MB_KEY=${MB_KEY} | |
- MB_OBJECTBOX_ANNOTATION_TOOL=true | |
ports: | |
- "8083:8080" | |
volumes: |
-- Idempotently add the tasks.id column | |
SET @table_name = 'tasks'; | |
SET @column_name = 'id'; | |
SET @preparedStatement = (SELECT IF( | |
( | |
SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS | |
WHERE table_name = @table_name | |
AND column_name = @column_name | |
AND data_type = 'BIGINT' | |
) > 0, |