dotfiles/.local/bin/tools/casttest
2020-07-04 14:23:27 +02:00

13 lines
414 B
Bash
Executable File

#!/bin/bash
video=$1
speed=${2:-1}
echo "speed: $speed"
slowness="$( echo $speed | bc -l )"
echo "slowness: $slowness"
rate=$( ffmpeg -i $video | sed -n "s/.*, \(.*\) tbr.*/\1/p" )
echo "oldrate: $rate"
newrate=$( echo "scale=0; $speed * $rate" | bc -l )
echo "newrate: $newrate"
command=ffmpeg -re -i "$video" -r $newrate filter:v "setpts=$slowness*PTS" pipe:1
mkchromecast --video --control --command "$command"