Changes of Revision 389
h264enc.spec
Changed
x
1
2
# norootforbuild
3
4
Name: h264enc
5
-Version: 10.4.3
6
+Version: 10.4.4
7
Release: 1
8
9
License: GPL-2.0+
10
11
12
13
%changelog
14
+* Thu Sep 10 2015 Grozdan Nikolov <neutrino8@gmail.com> 10.4.4
15
+ * Portability improvements. It should now work on other UNIXes
16
+
17
* Tue Sep 08 2015 Grozdan Nikolov <neutrino8@gmail.com> 10.4.3
18
* Removed the $ from the index of array variables
19
* Be more portable and use eval instead of seq in loops as seq is
20
h264enc-10.4.3.tar.gz/doc/ChangeLog -> h264enc-10.4.4.tar.gz/doc/ChangeLog
Changed
8
1
2
+2015-09-10 - h264enc 10.4.4
3
+ * Portability improvements. It should now work on other UNIXes
4
+
5
2015-09-08 - h264enc 10.4.3
6
* Removed the $ from the index of array variables
7
* Be more portable and use eval instead of seq in loops as seq is
8
h264enc-10.4.3.tar.gz/h264enc -> h264enc-10.4.4.tar.gz/h264enc
Changed
104
1
2
#!/usr/bin/env bash
3
-# $Id: h264enc, v 10.4.3, 2015/09/08, gn Exp $
4
+# $Id: h264enc, v 10.4.4, 2015/09/10, gn Exp $
5
#
6
# Encode BDs/DVDs/VCDs/video files to the H.264/AVC/MPEG-4 Part 10
7
# video format using MEncoder from MPlayer
8
9
10
shopt -u expand_aliases
11
export PATH=$PATH:/usr/local/bin
12
-version=10.4.3
13
+version=10.4.4
14
configversion=35
15
16
green() { echo -e "\e[1;32m$1\e[0;39;49m"; }
17
18
}
19
trap 'interrupt_iso_func' SIGHUP SIGTSTP SIGINT SIGQUIT SIGKILL SIGABRT SIGFPE SIGSEGV SIGTERM SIGPIPE SIGIO
20
check_space_func() {
21
- HDSPACE="$(df -m "$(dirname "$OUTPUT")" | tail -n 1 | awk '{print $4}')"
22
- if [ $HDSPACE -le 9216 ]; then
23
+ HDSPACE="$(df -k "$(dirname "$OUTPUT")" | tail -n 1 | awk '{print $4}')"
24
+ if [ $HDSPACE -le 9437184 ]; then
25
echo
26
error "-> You are running out of disk space in '$(dirname "$OUTPUT")'"
27
error "-> Space left over: $HDSPACE MiB ($(echo "scale=3; $HDSPACE/1024" | $BC -l | sed 's|^\.|0\.|') GiB)"
28
29
}
30
31
check_diskspace_func() {
32
- HDOUT="$(df -m "$(dirname "$OUTPUT")" | tail -n 1 | awk '{print $4}')"
33
- HDCONF="$(df -m "$TEMPDIR" | tail -n 1 | awk '{print $4}')"
34
- if [ $HDOUT -le 4096 -o $HDCONF -le 4096 ]; then
35
+ HDOUT="$(df -k "$(dirname "$OUTPUT")" | tail -n 1 | awk '{print $4}')"
36
+ HDCONF="$(df -k "$TEMPDIR" | tail -n 1 | awk '{print $4}')"
37
+ if [ $HDOUT -le 4194304 -o $HDCONF -le 4194304 ]; then
38
echo
39
echo "Note that you are running out of disk space in"
40
echo "the destination output directory and/or in the"
41
42
echo "process if you intend to do some of the above"
43
echo "tasks!"
44
echo
45
- error "Space left over in '$(dirname "$OUTPUT")': $HDOUT MiB"
46
- error "Space left over in '$TEMPDIR': $HDCONF MiB"
47
+ error "Space left over in '$(dirname "$OUTPUT")': $HDOUT KiB"
48
+ error "Space left over in '$TEMPDIR': $HDCONF KiB"
49
echo
50
printf "#### Press 'Enter' to continue, CTRL+C to exit ####"
51
read conenc
52
53
;;
54
esac
55
source "${AUDIOENC[i]}" >/dev/null 2>&1
56
- if [ -e "${audfile[i]}" -a "$(stat -c %s "${audfile[i]}")" -ge "20480" ]; then
57
+ if [ $(find "${audfile[$i]}" -type f -size +20480c 2>/dev/null | wc -l) -gt 0 ]; then
58
green "-> Track $i: Done"
59
else
60
error "-> Track $i: Failed"
61
62
rm -rf "$TEMPDIR" 2>/dev/null
63
64
# Report final file size
65
-MB_AVI="$(echo "scale=3; $(stat -c %s "$OUTPUT" 2>/dev/null)/1048576" | $BC -l | sed 's|^\.|0\.|')"
66
+MB_AVI="$(echo "scale=3; $(wc -c < "$OUTPUT")/1048576" | $BC -l | sed 's|^\.|0\.|')"
67
GB_AVI="$(echo "scale=3; $MB_AVI/1024" | $BC -l | sed 's|^\.|0\.|')"
68
echo
69
green "-> AVI file size: $MB_AVI MiB or $GB_AVI GiB ($OUTPUT)"
70
if [ "$avi_to_mkv" = "yes" ]; then
71
if [ -e "$MKVOUT" ]; then
72
- MB_MKV="$(echo "scale=3; $(stat -c %s "$MKVOUT" 2>/dev/null)/1048576" | $BC -l | sed 's|^\.|0\.|')"
73
+ MB_MKV="$(echo "scale=3; $(wc -c < "$MKVOUT" 2>/dev/null)/1048576" | $BC -l | sed 's|^\.|0\.|')"
74
GB_MKV="$(echo "scale=3; $MB_MKV/1024" | $BC -l | sed 's|^\.|0\.|')"
75
green "-> MKV file size: $MB_MKV MiB or $GB_MKV GiB ($MKVOUT)"
76
fi
77
78
green "-> AVCHD disc structure created in: $TSOUT"
79
;;
80
*)
81
- MB_TS="$(echo "scale=3; $(stat -c %s "$TSOUT" 2>/dev/null)/1048576" | $BC -l | sed 's|^\.|0\.|')"
82
+ MB_TS="$(echo "scale=3; $(wc -c < "$TSOUT" 2>/dev/null)/1048576" | $BC -l | sed 's|^\.|0\.|')"
83
GB_TS="$(echo "scale=3; $MB_TS/1024" | $BC -l | sed 's|^\.|0\.|')"
84
green "-> TS file size: $MB_TS MiB or $GB_TS GiB ($TSOUT)"
85
;;
86
87
88
if [ "$avi_to_mp4" = "yes" ]; then
89
if [ -e "$MP4OUT" ]; then
90
- MB_MP4="$(echo "scale=3; $(stat -c %s "$MP4OUT" 2>/dev/null)/1048576" | $BC -l | sed 's|^\.|0\.|')"
91
+ MB_MP4="$(echo "scale=3; $(wc -c < "$MP4OUT" 2>/dev/null)/1048576" | $BC -l | sed 's|^\.|0\.|')"
92
GB_MP4="$(echo "scale=3; $MB_MP4/1024" | $BC -l | sed 's|^\.|0\.|')"
93
green "-> MP4 file size: $MB_MP4 MiB or $GB_MP4 GiB ($MP4OUT)"
94
fi
95
96
97
if [ "$avi_to_ogm" = "yes" ]; then
98
if [ -e "$OGMOUT" ]; then
99
- MB_OGM="$(echo "scale=3; $(stat -c %s "$OGMOUT" 2>/dev/null)/1048576" | $BC -l | sed 's|^\.|0\.|')"
100
+ MB_OGM="$(echo "scale=3; $(wc -c < "$OGMOUT" 2>/dev/null)/1048576" | $BC -l | sed 's|^\.|0\.|')"
101
GB_OGM="$(echo "scale=3; $MB_OGM/1024" | $BC -l | sed 's|^\.|0\.|')"
102
green "-> OGM file size: $MB_OGM MiB or $GB_OGM GiB ($OGMOUT)"
103
fi
104