Skip to content

Instantly share code, notes, and snippets.

@chrisross
Created March 4, 2016 12:16
Show Gist options
  • Save chrisross/27c6461e4d919f8f8dd8 to your computer and use it in GitHub Desktop.
Save chrisross/27c6461e4d919f8f8dd8 to your computer and use it in GitHub Desktop.
Loop through directory of videos, playing each one. Useful for scrubbing through a massive collection of video using ffplay.
#!/usr/bin/env bash
# Hotkeys (While playing):
# @see http://linux.die.net/man/1/ffplay
# q, ESC Quit
# f Toggle full screen
# p, SPC Pause
# a Cycle audio channel
# v Cycle video channel
# t Cycle subtitle channel
# w Show audio waves
# left/right Seek backward/forward 10 seconds.
# down/up Seek backward/forward 1 minute.
# mouse click Seek to percentage in file corresponding to fraction of width.
export idx=1
for f in *; do
if [[ -f "${f}" ]]; then
ffplay -i "${f}" -window_title "${idx}: ${f}" -autoexit -stats
((idx+=1))
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment