Skip to content

Instantly share code, notes, and snippets.

@tonioriol
Created September 21, 2020 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonioriol/ec414dec61c1fe09d395618d77559241 to your computer and use it in GitHub Desktop.
Save tonioriol/ec414dec61c1fe09d395618d77559241 to your computer and use it in GitHub Desktop.
#!/bin/bash
for FILE in *; do
echo "${FILE}"
duration=$(ffprobe -i "${FILE}" -show_entries format=duration -v quiet -of csv="p=0")
nth_second=$(echo "${duration} - 2.3" | bc)
ffmpeg -i "${FILE}" -ss 0.1 -to "${nth_second}" "fixed-${FILE}"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment