File tree 1 file changed +14
-4
lines changed
1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
# ------------------------------------------------------------------
3
3
# Description:
4
- # Will add all tiff files in folder into one combined image
4
+ # Create motion history (aka "blurring") from a video file.
5
+ # Number of frames to include in the history can be specified.
5
6
#
6
7
# Usage:
7
8
# Place in folder with video files
8
9
# Make executable: chmod u+x [scriptname]
9
10
# Run script: sh [scriptname]
10
11
#
11
12
# Dependency:
12
- # Uses ImageMagick
13
+ # Uses FFmpeg
13
14
#
14
15
# Author:
15
16
# Alexander Refsum Jensenius
16
17
# University of Oslo
17
18
#
18
19
# Version:
20
+ # 0.2 - 2022-01-09
19
21
# 0.1 - 2020-03-01
20
22
# ------------------------------------------------------------------
21
23
22
24
23
25
if [ -z " $1 " ]; then
24
- echo " usage: ./mghistory.sh VIDEO [FRAMES=30 ]"
26
+ echo " usage: ./mghistory.sh VIDEO [FRAMES=10 ]"
25
27
exit
26
28
fi
27
29
@@ -30,4 +32,12 @@ NAMESTRING=`echo $FILENAME | cut -d'.' -f1`;
30
32
31
33
FRAMES=$2
32
34
33
- ffmpeg -i $FILENAME -filter:v tmix=frames=30:weights=" 10 1 1" ${NAMESTRING} _history.mp4
35
+ if [ -z " $FRAMES " ]; then
36
+ FRAMES=10
37
+ fi
38
+
39
+ # Creating weight sequence so that the first frames (the last in the sequence)
40
+ # get heigher weights and are more visible
41
+ WEIGHTS=` seq $FRAMES `
42
+
43
+ ffmpeg -i $FILENAME -filter:v tmix=frames=${FRAMES} :weights=" ${WEIGHTS} " ${NAMESTRING} _history.mp4
You can’t perform that action at this time.
0 commit comments