Skip to content

Instantly share code, notes, and snippets.

@adam000
Last active April 4, 2020 22:20
Show Gist options
  • Save adam000/cf3d3ef91eba806271e24675c2581c0b to your computer and use it in GitHub Desktop.
Save adam000/cf3d3ef91eba806271e24675c2581c0b to your computer and use it in GitHub Desktop.
A simple way to shorten Overwatch highlights from the comfort of WSL
#!/bin/bash
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
WINHOME="/mnt/c/Users/atg"
NPROCS=10
# NOTE: nothing in the ls arg can have spaces or this doesn't work
ls $WINHOME/Documents/Overwatch/videos/overwatch/*.mp4 | xargs -n 1 -l -P $NPROCS -i{} bash -c 'ffmpeg -hide_banner -loglevel debug -ss 00:00:04.800 -i "{}" -t 00:00:12.500 -c copy "/mnt/f/Shortened OW Highlights/$(basename "{}")" && rm "{}"'
IFS=$SAVEIFS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment