Introducing a simple script that we can use in a filter to change the fps of a recording

This commit is contained in:
Isaac Connor 2020-09-14 13:47:46 -04:00
parent 26cefda712
commit d93e9e351b
1 changed files with 45 additions and 0 deletions

45
utils/resample_event_video.sh Executable file
View File

@ -0,0 +1,45 @@
#!/bin/sh
FFMPEG=`which ffmpeg`;
if [ -z "$FFMPEG" ]; then
echo "You must install the ffmpeg package. Try sudo apt-get install ffmpeg";
exit;
fi
for i in "$@"
do
case $i in
-r=*|--rate=*)
FPS="${i#*=}"
shift
;;
-f=*|--file=*)
VIDEO_FILE="${i#*=}"
shift
;;
*)
EVENT_PATH="${i#*=}"
shift
;;
esac
done
if [ -z "$EVENT_PATH" ]; then
echo "You must specify the path to the event.";
exit 255
fi;
if [ -z "$FPS" ]; then
echo "You must specify the new fps.";
exit 255
fi;
$FFMPEG -i "$EVENT_PATH/$VIDEO_FILE" -filter:v fps=fps=$FPS "$EVENT_PATH/output.mp4"
echo $?
if [ $? -eq 0 ]; then
mv "$EVENT_PATH/output.mp4" "$EVENT_PATH/$VIDEO_FILE"
fi;
exit 0;