Skip to content

Instantly share code, notes, and snippets.

@vsimko
Last active June 29, 2017 10:57
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 vsimko/b61ec95a3bec0bce8a1547a9777f3375 to your computer and use it in GitHub Desktop.
Save vsimko/b61ec95a3bec0bce8a1547a9777f3375 to your computer and use it in GitHub Desktop.
# install required packages
sudo apt install mplayer kafkacat
# create a separate dir for the frames
mkdir frames
cd frames
# download video to vid.avi
curl -o vid.avi "http://www.engr.colostate.edu/me/facil/dynamics/files/drop.avi"
# extract frames from avi to PNG files (single PNG per Frame)
mplayer -vo png:z=6 vid.avi
# send all frames to kafka topic
ls -1 | while read FNAME
do
echo "Sending frame '$FNAME' to kafka queue..."
cat "$FNAME" | kafkacat -b BROKER -t topicname ...
# optionally sleep between frames
# sleep 1
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment