-
Notifications
You must be signed in to change notification settings - Fork 0
/
moviefrm-list
executable file
·64 lines (53 loc) · 1.29 KB
/
moviefrm-list
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
###############################################################################
# KM-MOD Image Classifier for Security Cameras
# Sensor Analytics Australia™ 2024
###############################################################################
DIRP=/mnt/SSD
FILPATH=./ffnames.txt
DV=R4
MOVPATH=$DIRP/MOVIE
MOV=`basename $FILPATH .txt`
MOV=$MOV-$DV
if [ $# == 0 ]
then
echo "usage FrameRate [ImgFileListName]"
exit 1
else
FR=$1
fi
if [ $# == 2 ]
then
FILPATH=$2
fi
if [ ! -d $MOVPATH ]
then
echo "Movie Path: $MOVPATH does not exist - edit in correct path"
exit 1
fi
if [ ! -d $DIRP ]
then
echo "Directory Path: $DIRP does not exist - edit in correct path"
exit 1
fi
rm -rf /tmp/tmp.* || true #clean up tmp
TMPD=`mktemp -d`
echo "$TMPD created"
#cat $FILPATH | xargs cp -t $TMPD
cp `cat $FILPATH` $TMPD
echo "Files: `ls $TMPD | wc -l` Copied to $TMPD"
echo `ls $TMPD | wc -l` files found
read -p "Continue? (y/n) " -n 1 -r
echo
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
exit 1
fi
echo "Ready to start movie making"
cd $TMPD
sleep 5 #time to see the above echoes"
cat *.jpg | ffmpeg -f image2pipe -r $FR \
-vcodec mjpeg \
-i - -vcodec libx264 -vf "pad=ceil(iw/2)*2:ceil(ih/2)*2" \
$MOVPATH/$MOV.mp4 -y
echo "jpg --> $MOVPATH/$MOV.mp4"