Tips & Tricks of the trade: video compression with ffmpeg

Tips & Tricks of the Trade: video compression with ffmpeg

When you need to share a recording that isn’t ginormous I’m converting a video to GIF file with ffmpeg:

1
2
3
4
5
6
7
8
ffmpeg \
  -i IMG_1288.MOV \
  -ss 00:00:00.000 \
  -pix_fmt rgb24 \
  -r 10 \
  -s 320x240 \
  -t 00:00:10.000 \
  IMG_1288.gif

When you need to delete 10s of 1000’s of s3 objects

1
2
3
4
5
export BUCKET=ecs-dbt-dev-staging-bucket
export PREFIX="Connecticut/EmplId-Empl"
aws s3api list-objects-v2 --bucket $BUCKET --prefix $PREFIX --output text --query \
'Contents[].[Key]' | grep -v -e "'" | tr '\n' '\0' | xargs -0 -P2 -n500 bash -c \
'aws s3api delete-objects --bucket $BUCKET --delete "Objects=[$(printf "{Key=%q}," "$@")], Quiet=true"' _ 

#tips #video_compression #work