esp-pixelbox/tools/movie.sh

16 lines
765 B
Bash
Raw Normal View History

#!/bin/bash
input=$1
FULLSECONDS="$(ffprobe -i "${input}" -show_entries format=duration -v quiet -of csv="p=0" | sed 's/\..*//')"
echo "Seeking ${FULLSECONDS} seconds"
for i in $(seq 0 ${FULLSECONDS})
do
# ffmpeg -y -ss ${i} -i "${input}" -r 1 -vframes 1 -vf scale=8:8 -f image2pipe - 2>/dev/null | convert - -rotate 90 -normalize rgb:- >/dev/udp/172.23.23.54/4210
ffmpeg -y -ss ${i} -i "${input}" -r 1 -vframes 1 -f image2 /tmp/movieimg.jpg 2>/dev/null
clear; jp2a /tmp/movieimg.jpg
ffmpeg -y -ss ${i} -i "${input}" -r 1 -vframes 1 -vf scale=8:8 -f image2 /tmp/movieimg.png 2>/dev/null
# convert /tmp/movieimg.png -rotate 90 -normalize rgb:- >/dev/udp/172.23.23.54/4210
convert /tmp/movieimg.png -rotate 90 rgb:- >/dev/udp/172.23.23.54/4210
sleep 1
done