Last active
June 29, 2017 10:57
-
-
Save vsimko/b61ec95a3bec0bce8a1547a9777f3375 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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